Ordered graphs of bounded twin-width
OOrdered graphs of bounded twin-width
Pierre Simon and Szymon Toru ´nczykFebruary 16, 2021
Abstract
We consider hereditary classes of graphs equipped with a total order. We provide multipleequivalent characterisations of those classes which have bounded twin-width. In particular,we prove that those are exactly the classes which avoid certain large grid-like structures andinduced substructures. From this we derive that the model-checking problem for first-orderlogic is fixed-parameter tractable over a hereditary class of ordered graphs if, and – undercommon complexity-theoretic assumptions – only if the class has bounded twin-width. Wealso show that bounded twin-width is equivalent to the NIP property from model theory, aswell as the smallness condition from enumerative combinatorics. We prove the existence ofa gap in the growth of hereditary classes of ordered graphs. Furthermore, we prove a gridtheorem which applies to all monadically NIP classes of structures (ordered or unordered), orequivalently, classes which do not transduce the class of all finite graphs.
The recently introduced notion of twin-width [BKTW20a, BGK + , BGK +
20] is a graph widthparameter with remarkable properties. It measures how well a given graph can be recursivelydecomposed into parts which have simple interactions with each other (see Sec. 2 for a defini-tion). The notion generalizes to arbitrary relational structures equipped with unary and binaryrelations.Many well-studied classes have bounded twin-width: the class of planar graphs, and moregenerally, any class of graphs excluding a fixed minor; the class of cographs and more gen-erally, any class of bounded cliquewidth; posets of bounded width; and classes of permuta-tions (viewed as sets with two total orders) omitting a fixed permutation as an induced sub-structure. Moreover, classes of bounded twin-width enjoy good properties of combinatorial,algorithmic, and logical nature. For instance, classes of bounded twin-width are closed underfirst-order transductions, are small (contain n ! · O ( n ) distinct labelled graphs on n vertices), andare χ -bounded (the chromatic number can be bounded in terms of the clique number) [BGK + ].Furthermore, it is shown that model-checking first-order logic is fixed-parameter tractable onclasses of bounded twin-width, assuming the input graph G is given together with a certificate of having bounded twin-width (a certain sequence of operations). More precisely, given a first-order sentence ϕ , a graph G , and a certificate that G has twin-width at most d , there is an al-gorithm which determines whether G satisfies ϕ in time f ( ϕ , d ) · | V ( G ) | c for some computablefunction f : N × N → N and fixed constant c ∈ N .For each of the classes C mentioned above there is an algorithm which, given a graph G ∈ C , computes some certificate that G has twin-width bounded by a constant, in polynomial1 a r X i v : . [ c s . L O ] F e b ime [BKTW20a]. Hence, for each of those classes C , model-checking first-order logic is fixed-parameter tractable, generalizing many previous results.The appropriate certificate of having bounded twin-width is usually obtained from a suit-able ordering of the vertices. The adjacency matrix of the graph with respect to this order shouldbe simple in a certain sense. The existence of such an order is essential in proving results aboutclasses of bounded twin-width, as well as obtaining efficient algorithms. This suggests that ordered graphs of bounded twin-width are the more fundamental object. Main result
We solve a number of problems which are open for graphs of bounded twin-width, in the caseof ordered graphs of bounded twin-width. Among other things, we show that if a class C of or-dered graphs has bounded twin-width, then for each G ∈ C , a certificate that G has twin-widthbounded by a constant can be computed in polynomial time. Consequently, model-checkingis fixed-parameter tractable on C . We also prove that the converse holds, under commoncomplexity-theoretic assumptions.More importantly, we give multiple characterisations of classes of ordered graphs of boundedtwin-width, connecting notions from various areas of mathematics and theoretical computerscience, and solving several open problems on the way.The most tangible characterisation is in terms of certain forbidden substructures, dubbed semigrids . Those are two-dimensional variations of half-graphs, matchings, and complementsof matchings which are depicted in Fig. 1. Say that two sets X , Y of vertices of an ordered graph G form an R-graph , where R ∈ { (cid:54) , (cid:62) , = , (cid:54) = } , if the i th smallest element in X is adjacent to the j thsmallest element in Y if and only if iRj , for all 1 (cid:54) i , j (cid:54) | X | , see Fig. 1. F IGURE A (cid:54) -graph, a (cid:62) -graph, a = -graph, and a (cid:54) = -graph formed by sets X (six vertices on the top) and Y (sixvertices on the bottom), where X and Y are both ordered from left to right. Note that the edges within X and withinY may be arbitrary. An m × n semigrid of type R ∈ { (cid:54) , (cid:62) , = , (cid:54) = } is an ordered graph G = ( V , E , (cid:54) ) whose domain V can be partitioned into m + (cid:54) on V ) I , I , . . . , I m with n + I < . . . < I m , such that I and I i form an R -graph, for i =
1, . . . , m (cf. Fig. 2). Note that there are many m × n -semigrids of a given type, as the above specification F IGURE A × -semigrid of type (cid:62) . The vertices are ordered left to right in each interval.
2s not complete: the adjacencies within I ∪ · · · ∪ I m , as well as the adjacencies within I , andalso the relative order between the interval I and the intervals I , . . . , I m , are all left unspecified.However, using a Ramsey argument one can prove that a large regular n × n -semigrid can befound as an induced substructure of a sufficiently large semigrid n (cid:48) × n (cid:48) (see Section 4 for adefinition). In particular, a regular m × n -semigrid is uniquely specified by the dimensions m , n (cid:62) schemes .Another characterisation is in terms of (simple first-order) interpretations . Interpretations area means of producing new structures out of old ones, using formulas. The new structure hasthe same domain as the old one (or its subset defined by a formula δ ( x ) ) while each of its re-lations is defined by a formula ϕ ( x , y ) interpreted in the old structure. For example, there isan interpretation which transforms a given graph G into its edge-complement (using the for-mula ¬ E ( x , y ) ), and an interpretation which transforms G into its square (using the formula ∃ z . E ( x , z ) ∧ E ( z , y ) ). Transductions are a similar notion, but additionally allow to arbitrarilycolor the old structure before applying the interpretation and then use the colors in the formu-las. Say that C interprets the class of all graphs if there is an interpretation I such that every(finite) graph G can be obtained as the result of I applied to some structure in C . Replacinginterpretations with transductions, we say that C transduces the class of all graphs. It is knownthat no class of bounded twin-width transduces all graphs.We may now state our main result, concerning classes of ordered graphs which are heredi-tary , that is, closed under taking induced substructures. Among others, it provides a dichotomyresult for all such classes: either they have bounded twin-width, and are therefore very well-behaved, or otherwise, they contain arbitrarily large regular n × n -semigrids, and are then un-tamable. Theorem 1.1.
The following conditions are equivalent for a hereditary class C of finite, ordered graphs:1. C has bounded twin-width,2. C does not contain arbitrarily large regular n × n-semigrids,3. C does not interpret the class of all graphs,4. C does not transduce the class of all graphs,5. model-checking first-order logic is fixed-parameter tractable on C (assuming FPT (cid:54) = AW [ ∗ ] ),6. C contains at most O ( n ) structures with n elements, up to isomorphism,7. C contains fewer than (cid:98) n (cid:99) ! structures with n elements, up to isomorphism,8. there are k , t ∈ N such that for all G ∈ C , if the adjacency matrix of G is cut into t zones usingt − vertical and t − horizontal lines, then there is a zone with no more than k non-identicalrows and no more than k non-identical columns. The above result connects notions from logic, enumerative combinatorics, parameterizedcomplexity, graph theory and matrix theory. However, at the core of our approach are tools andideas originating from model theory .As our second main result, we provide further characterisations of bounded twin-widthclasses in terms of notions which originate from model theory, but which also transpire in algo-rithmic and structural graph theory. We prove that generalizations of the conditions (2), (3), and(8) hold for arbitrary monadically NIP classes C of relational structures. Those can be equivalently3haracterised as classes (of finite or infinite structures) which do not transduce the class of allfinite graphs. They include all graph classes of bounded twin-width (with or without an order),but also all transductions of nowhere-dense classes (see below).The following theorem is a vast generalization of some of the key implications in Theo-rem 1.1. Theorem 1.2.
For any class of structures C , consider the following statements:9. C does not transduce the class of all graphs,10. C is monadically NIP,11. C does not define large grids (cf. Def. 4),12. C is -dimensional (cf. Def. 12),13. C is a regular class (cf. Def. 13).Then the implications (9) ↔ (10) → (11) → (12) → (13) hold. For classes of binary, ordered structures,the above conditions are all equivalent to:14. the class of all finite induced substructures of structures in C has bounded twin-width,15. the class of all finite induced substructures of structures in C is NIP. The notion (11) of defining large grids generalizes the notion (2) of containing large semi-grids to arbitrary structures, while the notion (13) of regularity generalizes condition (8) fromTheorem 1.1. In particular, those notions do not require the structures to be ordered, finite, orbinary. The notion of 1-dimensionality has a somewhat geometric flavor. It is defined in termsof a variant of forking independence – a central concept in stability theory, generalizing e.g.independence in vector spaces or algebraic independence.Theorem 1.2 provides a key ingredient in our proof of Theorem 1.1 – a grid theorem . Moreimportantly, we believe that it may be of independent interest, and possibly of broader ap-plicability than just in the context of ordered structures. For example, by Theorem 1.2, allgraph classes of bounded twin-width (without an order) and all interpretations of nowhere-dense classes [NOdM11] are regular.The implications (11) → (12) → (13) are proved using model-theoretic tools. They yield a gen-eral grid theorem for classes that are not regular in the sense of (13).Very roughly, the proof of Theorem 1.1 can be summarized as follows. The goal is to showthat if C is a class of ordered graphs which has unbounded twin-width, then C contains arbi-trarily large regular semigrids. We do it in the following steps:1. If a class C of ordered graphs satisfies condition (8) then it has bounded twin-width. Thisgeneralizes a result from [BKTW20a], and uses similar methods.2. Suppose C has unbounded twin-width; then it fails condition (8) and in particular, is notregular. By Theorem 1.2, C defines large grids.3. Large grids are then made more structured using a Ramsey result in order to exhibit arbi-trarily large regular semigrids in C . 4nce C is known to have large regular semigrids, conditions (3)-(7) in Theorem 1.1 are easilyshown to fail.Some parts of our proof are ineffective, in particular, we use the compactness theorem forfirst-order logic. Quite remarkably, we are still able to derive effective bounds and algorithms.For instance, we get a polynomial-time algorithm approximating the twin-width of a givenordered graph G : Theorem 1.3.
There is a computable function f : N → N and an algorithm which inputs an orderedgraph G, and computes in polynomial time a certificate that G has twin-width at most f ( twin-width ( G )) . This, combined with the result of [BKTW20b] yields fixed-parameter tractability of the model-checking problem for classes of ordered graphs of bounded twin-width, proving the implication(1) → (5). We also prove the converse implication, under the common complexity-theoretic as-sumption FPT (cid:54) = AW[ ∗ ].Theorem 1.1 is proved in the greater generality of ordered structures over an arbitrary binarysignature.Our results generalize several known results, including the celebrated Stanley-Wilf conjec-ture about permutations avoiding a fixed permutation pattern. Moreover, we solve several openquestions. This is discussed below. Related work
Enumerative combinatorics.
Enumerative combinatorics is involved in counting the numberof labelled or unlabelled structures in a given class of structures. Marcus and Tardos proved [MT04]the Stanley-Wilf conjecture, that every class of permutations (viewed as sets equipped with twolinear orders) avoiding a fixed permutation as a substructure has growth 2 O ( n ) , that is, con-tains at most 2 O ( n ) unlabelled structures with n elements (up to isomorphism). In particular, ahereditary class of permutations either has growth 2 O ( n ) or has factorial growth n !. The Marcus-Tardos theorem is fundamental in twin-width theory, and underlies many of the argumentsused in [BKTW20a, BGK + , BGK + ↔ (2) in Theorem 1.1, as every permutation is a substructure ofany sufficiently large regular semigrid (defined suitably for structures with two linear orders).Our result proves the existence of a gap in the growth of hereditary classes of orderedgraphs: either the class has exponential growth 2 O ( n ) or, or otherwise it has at least factorialgrowth (cid:98) n (cid:99) !. This generalizes previous results and answers a problem posed by Bolagh, Bol-lobás and Morris [BBM06, Sec. 8].In [BGK + ] it is shown that every class of bounded twin-width is small, that is, contains atmost n !2 O ( n ) labelled structures with n elements (that is, with domain {
1, . . . , n }). It has beenalso conjectured that the converse holds for every hereditary class of graphs. Our equiva-lence (1) ↔ (6) in Theorem 1.1 confirms this conjecture in the case of ordered graphs. Note thata class of ordered graphs is small if and only if it contains at most 2 O ( n ) unlabelled structuresof size n (that is, up to isomorphism) as any ordered structure yields exactly n ! distinct labelledstructures. Transductions and interpretations.
The study of transductions in theoretical computer sci-ence originates from the study of word-like and tree-like structures, such as graphs of boundedtreewidth [ALS88] or graphs of bounded cliquewidth [Cou94].5y results of [BKTW20a], classes of bounded twin-width are closed under transductions; inparticular, no class of bounded twin-width transduces (nor interprets) the class of all graphs.The equivalence (1) ↔ (4), characterising hereditary classes of ordered graphs of boundedtwin-width as precisely those which do not transduce the class of all graphs, is not unlike aresult [CiO07] characterizing classes of bounded cliquewidth as precisely those which do nottransduce the class of all graphs via some transduction of counting monadic second-order logic(CMSO, an extension of first-order logic).Note that in our result we require the graphs to be ordered for the implication (4) → (1) tohold: the class C of graphs of maximum degree 3 has unbounded twin-width [BGK + ], but doesnot transduce the class of all graphs as it is nowhere dense (see below).Both the above result for cliquewidth and our results are obtained using appropriate gridtheorems. Grid theorems.
Grid theorems are dichotomy results in structural graph theory which statethat either a structure has a small width with respect to a considered width parameter, or oth-erwise, a grid-like obstruction can be found in the structure. For example, this applies to thetreewidth parameter and planar grids occurring as minors [RS86]. It also applies to cliquewidthand planar grids being definable in CMSO [CiO07]. As CMSO formulas can define the rela-tions of being in the same row/column in a planar grid, this allows to encode any graph ina subgraph of a sufficiently large grid, implying the result mentioned earlier about classes ofbounded cliquewidth.Our main result also proves an appropriate grid theorem for classes of ordered graphs ofbounded twin-width, as made precise by the notion of regular semigrids. For such semigridsthere is a first-order formula which defines the relation of being in the same interval I , . . . , I n (‘same row’), and the relation of having the same distance from the beginning of an interval(‘same column’). From this it follows that if a hereditary class has unbounded twin-width thenit interprets the class of all graphs.There are other known grid theorems. The Marcus-Tardos result itself proves a result of thiskind, stating that if a square 0 − Monadic NIP.
Model theory classifies typically infinite structures according to the combina-torial complexity of families of definable sets. This is usually done through the introduction oftameness properties. The most important such notion is that of stability. A structure is stableif no formula ϕ ( x , y ) encodes arbitrary large half-graphs ( (cid:54) -graphs as in Fig. 1), which roughlymeans that there is no definable order on large subsets of the structure. Stability captures thetameness properties of families of algebraic sets. A related, weaker, notion is that of NIP: astructure is NIP if every definable family of sets has finite VC-dimension. This captures thetameness properties of families of sets arising from geometric settings (for instance families ofsemi-algebraic sets of bounded complexity have finite VC-dimension).The notion of monadically NIP is a much stronger requirement which says that the structureis NIP even if every subset of the domain can be used as a unary predicate.6his notion is closely related to notions which are studied in theoretical computer scienceand structural graph theory.As mentioned, a class of structures C is monadically NIP if and only if it does not transducethe class of all graphs. Hence, Theorem 1.1 proves that a class of ordered graphs is monadicallyNIP if, and only if it has bounded twin-width.Examples of monadically NIP graph classes include all nowhere dense classes. A class ofgraphs C is nowhere dense if for all r ∈ N there is some t ∈ N such that the r -subdivision ofthe t -clique is not a subgraph of any graph in C . Examples include the class of graphs withmaximum degree bounded by a constant (those classes have unbounded twin-width [BGK + ]),as well as every proper minor-closed graph class (here the twin-width is bounded). A subgraph-closed class of graphs is nowhere dense if and only if it is monadically NIP [AA14].Monadically NIP classes are closed under transductions, so any transduction of a nowheredense graph class is also monadically NIP, but not necessarily nowhere dense.Theorem 1.2 provides a grid theorem for any monadically NIP class of structures – not nec-essarily ordered, binary, nor finite. Tractability of model-checking.
Testing if a given sentence ϕ of first-order logic holds in agiven graph G takes time O ( | V ( G ) | | ϕ | ) using the naive algorithm, and it is conjectured that theexponential dependency on | ϕ | cannot be avoided. More precisely, it is conjectured that model-checking first-order logic is not fixed-parameter tractable on the class of all graphs, which isequivalent to the conjecture FPT (cid:54) = AW[ ∗ ] from parameterized complexity theory [FG06].There are several known classes C of structures for which model-checking first-order logic isfixed-parameter tractable. To the best of our knowledge, all known tractable hereditary classesare monadically NIP .Altogether, the following picture emerges, assuming FPT (cid:54) = AW[ ∗ ]:1. if C is a subgraph-closed class of graphs then C is monadically NIP if, and only if model-checking first-order logic is fixed-parameter tractable over C [GKS14],2. if C is a hereditary class of ordered graphs then C is monadically NIP if, and only ifmodel-checking first-order logic is fixed-parameter tractable over C .The last item is by the equivalence (1) ↔ (5) in our main result, Theorem 1.1, both implicationsbeing new.There are a few hereditary graph classes there are known to be tractable for first-order logic,but are not covered by the items above. Those include:– classes of structures of bounded twin-width for which there is an effectively computablecertificate of having bounded twin-width (this includes all the examples from the firstparagraph),– map graphs [EK17],– first-order transductions of graph classes with bounded maximum degree [GHO + +
20, Conj. 8.2] implies that if a class C does not transduce all graphs,equivalently, C is monadically NIP, then model-checking first-order logic is fixed-parameter Tractable classes that are not hereditary include for example the class of all finite abelian groups [BM15] C (the conjecture there is actually even stronger). This would generalize all theabove.Theorem 1.1 confirms this conjecture in the case of ordered binary structures. Theorem 1.2provides a tool for approaching the conjecture for all monadically NIP classes, by providing agrid theorem for such classes. Independent work.
A few days before this paper was submitted, Bonnet, Giocanti, Ossona deMendez, and Thomassé reported [BGdMT21] essentially the same result as our Theorem 1.1 andTheorem 1.3. Our results were obtained independently, and most likely using different methods(we were unable to verify this in the short time before submission). The key differences betweenour results and the results of [BGdMT21] are summarized below:– Part of our proof is not effective, as it uses tools from model theory, including the compact-ness theorem for first-order logic. In particular, we do not obtain an explicit upper boundon the twin-width of a graph avoiding a fixed regular n × n -semigrid. We do, however,obtain a computable bound. It should not be difficult to extract some elementary boundfrom our proof, but this falls short of the explicit bounds obtained in [BGdMT21].– The lower bound (cid:98) n (cid:99) ! in the growth of hereditary classes of unbounded twin-width (7)in Theorem 1.1 is improved to n ! in [BGdMT21]. Proving this requires substantially moreeffort than our bound, which falls trivially out of the existence of large regular semigrids.– On the other hand, [BGdMT21] does not provide any result analogous to our second mainresult, Theorem 1.2, which applies to all classes of structures – possibly unordered, ofarbitrary arity, and infinite. For n ∈ N denote [ n ] = {
0, . . . , n − } . Order.
Order means total order. A subset C of an ordered set ( X , (cid:54) ) is convex , or an interval , if a , b ∈ C and a (cid:54) c (cid:54) b imply c ∈ C , for all a , b , c ∈ X . A convex partition of X is a partition intoconvex subsets. Structures.
We consider the setting of relational structures. Fix a relational signature Σ .Let S be a Σ -structure. We identify S with its domain when writing e.g. a ∈ S or A ⊆ S.Tuples of elements of S are denoted ¯ a ∈ S k or ¯ a ∈ S ¯ x , where ¯ x is a finite set of variables. In thelatter case, the tuple ¯ a can be seen as a valuation of the variables ¯ x .If S and T are two Σ -structures then S is an induced substructure of T if the domain of S iscontained in the domain of T and for every relation symbol R ∈ Σ of arity k and ¯ a ∈ S k , R ( ¯ a ) holds in S if and only if R ( ¯ a ) holds in T. Formulas.
We only consider first-order Σ -formulas in what follows.If α is a formula and ¯ x is a finite set of variables then we may write α ( ¯ x ) to indicate that thefree variables of α are among ¯ x . 8or a formula α ( ¯ x ) and tuple ¯ a ∈ S ¯ x write S | = α ( ¯ a ) to denote that ¯ a satisfies α in S. Denote α ( S ) = { ¯ a ∈ S ¯ x | S | = α ( ¯ a ) } .If α ( ¯ x ) is a formula and ¯ x is partitioned as ¯ x = ¯ u ∪ ¯ v then we may write α ( ¯ u ; ¯ v ) to signifythis partition, and that ¯ v will be treated as variables ranging over parameters . For instance, if S isa structure and ¯ b ∈ S ¯ v is a tuple then θ ( ¯ x ; ¯ b ) denotes the formula with parameters obtained from θ by replacing the variables ¯ v by ¯ b , treated as constants. Denote α ( S; ¯ b ) = { ¯ a ∈ S ¯ u | S | = α ( ¯ a ; ¯ b ) } . Atomic types. An atomic formula is a formula of the form R ( x , . . . , x k ) where R ∈ Σ is ofarity k . For a k -tuple ¯ a ∈ S k , its atomic type , denoted atp ( ¯ a ) , is conjunction of all formulas α ( x , . . . , x k ) such that S | = α ( ¯ a ) and α is either an atomic formula, or its negation. Up tobijection, atp ( ¯ a ) is uniquely determined by the isomorphism type of the substructure S (cid:48) of Sinduced by { a , . . . , a k } , expanded with k constants interpreted as a , . . . , a k .An atomic type with variables ¯ x is a conjunction which contains as a conjunct every atomicformula R ( x , . . . , x k ) for R ∈ Σ and x , . . . , x k ∈ ¯ x , or its negation ¬ R ( x , . . . , x k ) . θ -types over a set. Let θ ( ¯ u ; ¯ v ) be a formula and S a structure. For a tuple ¯ a ∈ S ¯ u and a set B ⊆ Sof parameters define the type of ¯ a over B as:tp θ ( ¯ a / B ) = { ¯ b ∈ B ¯ v | S | = θ ( ¯ a ; ¯ b ) } .Equivalently – up to bijection – tp θ ( ¯ a / B ) is the set of formulas θ ( ¯ u ; ¯ b ) with parameters ¯ b from B that are satisfied by ¯ a in S.For a set A ⊆ S, denote Types θ ( A / B ) : = { tp θ ( ¯ a / B ) | ¯ a ∈ A ¯ u } .Note that if Types θ ( A / B ) (cid:54) k then Types ˆ θ ( B / A ) (cid:54) k , where ˆ θ ( ¯ v ; ¯ u ) = θ ( ¯ u ; ¯ v ) .If Σ is a binary signature then denoteTypes Σ ( A / B ) : = { tp R ( a / B ) | ¯ a ∈ A , R ∈ Σ } .Similarly as above, if Types Σ ( A / B ) (cid:54) k then Types Σ ( B / A ) (cid:54) | Σ | k . Moreover, if Types R ( A / B ) (cid:54) k R for all R ∈ Σ then Types Σ ( A / B ) (cid:54) ∏ R ∈ Σ k R . Homogeneity.
Let S be a structure over a binary relational signature Σ and let X , Y ⊆ S. Thepair X and Y is homogeneous if | Types Σ ( X / Y ) | = | Types Σ ( Y / X ) | = Example 2.1.
In a graph G , a pair X , Y ⊆ G is homogeneous if and only if it is homogeneous inthe sense considered in Section 1. If G is an ordered graph then a pair X , Y ⊆ G is homogeneousif X and Y are homogeneous in G as an unordered graph, and moreover, either all elements of X are strictly smaller than all elements of Y , or vice-versa.9 nterpretations and transductions. Let Σ and Γ be relational signatures. An interpretationI : Σ → Γ consists of a Σ -formula δ ( x ) and for each symbol R ∈ Γ of arity k , a Σ -formula ϕ R ( x , . . . , x k ) . Given a Σ -structure S, define I ( S ) as the Γ -structure with domain D = δ ( S ) equipped with the relation ϕ R ( S ) ∩ D k interpreted as R , for each R ∈ Γ of arity k . A transductionT : Σ → Γ is a (cid:98) Σ -interpretation for some (cid:98) Σ extending Σ by unary predicates. Given a Σ -structureS, define T ( S ) as the set of Γ -structures I ( (cid:98) S ) , where (cid:98) S ranges over all (cid:98) Σ -structures expanding Sby arbitrarily interpreting the unary predicates in (cid:98) Σ − Σ in (cid:98) S.Interpretations and transductions are closed under compositions: if Σ I −→ Σ I −→ Σ are two interpretations (resp. transductions) then there is an interpretation (resp. transduction) I ◦ I : Σ → Σ such that ( I ◦ I )( S ) = I ( I ( S )) , for every Σ -structure S. Remark 2.1.
What is defined above is a special case of a more general notion of interpretationsconsidered in model theory. The restricted interpretations that we consider here are sometimescalled simple interpretations, but we drop this qualifier in this paper.
Definition 1.
A class of Γ -structures D is an interpretation (resp. transduction ) of a class of Σ -structures C if there is an interpretation (resp. transduction) T : Σ → Γ such that for everystructure D ∈ D there is some C ∈ C with D ∈ T ( C ) .In this case we also say that C interprets (resp. transduces ) D . Classes of structures.
We consider classes C of structures that are all over a common relationalsignature Σ . We assume that C is closed under isomorphisms, that is, if A and B are isomorphicstructures then either both belong to C or both do not belong to C . A class of structures is hereditary if it is closed under taking induced substructures.We say that C is a class of binary structures if Σ is a relational signature with relation symbolsof arity at most two. We do not restrict only to classes of finite structures. However, graphs arealways assumed to be finite (specifically, when we say that C interprets the class of all graphs).By a class of ordered structures we mean a class of structures over a signature including thesymbol (cid:54) which is interpreted as an order in each structure from the class. Twin-width
A partition P of the domain of a structure S has red-degree at most d (for d ∈ N ) if for every X ∈ P there are at most d sets Y ∈ P other than X such that X and Y are not homogeneous.A contraction sequence in a finite structure S is a sequence of partitions P , P , . . . , P n of S suchthat:– P has one part,– P n is the partition into singletons,– P i + is obtained from P i by splitting one of the parts of P i into two, for i =
1, . . . , n − Definition 2 (Twin-width).
Fix d ∈ N . A finite structure S over a binary signature has twin-width at most d if it has a contraction sequence consisting of partitions of red-degree at most d .10 class C of finite, binary structures has bounded twin-width if there is some d ∈ N such thatevery S ∈ C has twin-width at most d . Example 2.2.
A class of graphs has twin-width 0 if and only if it is a class of cographs, that is,graphs that can be obtained from one-vertex graphs by the operations of disjoint union andedge-complement.
Example 2.3 ([BKTW20b]).
The following classes have bounded twin-width:– every proper minor-closed class of finite graphs,– every class of graphs of bounded clique-width,– every class of posets of bounded width,– every class of permutations that excludes a fixed permutation pattern.On the other hand, the following classes do not have bounded twin-width:– the class of all finite graphs,– the class of all bipartite graphs,– the class of all graphs of degree at most 3 [BGK + ].The following is a consequence of [BKTW20b], Theorems 10 and 14. Fact 1 ([BKTW20b]) . The following conditions are equivalent for a class of finite binary structures C :1. C has bounded twin-width,2. There is some t ∈ N such that for every structure S ∈ C there is an order on S such that forevery two convex partitions L and R of S into t parts, there are L ∈ L and R ∈ R such that | Types Σ ( L / R ) | = or | Types Σ ( R / L ) | = . In the case of graph classes C , the second condition above means the following: for every G ∈ C there is an order (cid:54) on G such that in the adjacency matrix M of G along this order, forevery partition R of the rows of M and partition C of the columns of M into convex intervals,there is some pair R ∈ R and C ∈ C such that the submatrix M [ R × C ] has either all rows equal,or all columns equal. Fact 2 ([BKTW20b]) . Classes of bounded twin-width are closed under:1. expanding by unary predicates: if C is a class of bounded twin-width and C (cid:48) is a class ofstructures such that each S (cid:48) ∈ C (cid:48) is an expansion of some S ∈ C by unary predicates, then C (cid:48) hasbounded twin-width.2. taking induced substructures : if C has bounded twin-width and C (cid:48) is a class such that everystructure in C (cid:48) is an induced substructure of some structure in C , then C (cid:48) has bounded twin-width.3. first-order transductions: if C is a class of bounded twin-width and T is a first-order transduc-tion, then T ( C ) is a class of bounded twin-width; . expanding by compatible orders: if C is a class of bounded twin-width then there is an orderedexpansion C (cid:48) of C (that is, a class of ordered structures C (cid:48) such that for each structure in S ∈ C ,the structure S with some order belongs to C (cid:48) ) such that C (cid:48) has bounded twin-width.Proof. (3) follows from [BKTW20b, Theorem 39]. (1) and (2) are special cases (also (2) is imme-diate by definition: when taking a substructure induced by A , the same contraction sequence,restricted to A , works).We show (4). Let S be a structure and let P , . . . , P n be its contraction sequence. There is anorder (cid:54) on S such that each partition P i is convex. Indeed, order the parts of P i by inductionon i : P has just one part, so there is nothing to do, whereas P i + is obtained from P i by mergingsome two part X , X of P i into one parts X ∪ X of P i + . By induction, X and X are alreadyordered, and order X ∪ X by declaring (arbitrarily) that X < X .As each partition P i is convex with respect to (cid:54) , a pair of its parts that was homogeneousin S remains homogeneous in ( S, (cid:54) ) . Hence, the contraction sequence P , . . . , P n has the samered-degree in S as in ( S, (cid:54) ) .Given a class of structures C of twin-width bounded by d , pick a contraction sequence ofred-degree at most d for each structure S ∈ C and then expand S by the order as defined above.This yields a class of ordered structures C (cid:48) of red-degree at most d .Morally, an ordered expansion G (cid:54) of G with tww ( G (cid:54) ) with twin-width bounded by a func-tion of tww ( G ) is the same as G together with a contraction sequence. In one direction, given G together with a contraction sequence we can compute (in linear time) a total order (cid:54) on G such that tww ( G (cid:54) ) = tww ( G ) , described as above. The converse direction is not that clear,however. We will prove (cf. Section 7) there is a polynomial-time algorithm which inputs atotally ordered structure G (cid:54) and outputs its contraction sequence of red-degree f ( tww ( G (cid:54) )) ,for some computable function f . A contraction sequence of G (cid:54) is also a contraction sequenceof G . Our proof proceeds in several steps, which utilise various notions which turn out to be equiv-alent to bounded twin-width. We explain those notions and outline the proof below. Figure 3may be helpful in tracing the implications.The first notion is as follows.
Definition 3 ( ( k , t ) -simple). An ordered binary structure S is ( k , t ) -simple if for every pair ofconvex partitions L , R with |L| = |R| (cid:62) t of S, there are L ∈ L and R ∈ R such that | Types Σ ( L / R ) | (cid:54) k and | Types Σ ( R / L ) | (cid:54) k .For an ordered graph G this means that if the set of rows and set of columns of the adjacencymatrix of G are partitioned into t intervals each, then there there is a submatrix induced by sometwo of those intervals which has at most k distinct rows and at most k distinct columns. Thisperspective can be adapted to binary structures, by suitably defining their adjacency matrices(cf. Sec. 6).As a first step, we prove that ( k , t ) -simple classes have bounded twin-width. Theorem 3.1.
Every ( k , t ) -simple finite ordered binary structure has twin-width O ( kt ) . BKTW20b](cf. Fact. 2) Sec. 5, usesgrid RamseySec. 8 and 9,model-theoretic Sec. 6, usesMarcus-TardosSection 7 [BGK + ]Section 4boundedtwin-widthdoes not interpretall graphs fpt model-checking smallno large quantifier-free gridsno large regular semigrids ( k , t ) -simple F IGURE Implications among the conditions in Theorem 1.1. Σ .Fix a first-order formula ϕ ( ¯ x , ¯ y , z ) , where ¯ x and ¯ y are sets of variables and z is a single vari-able. An m × n grid defined by ϕ in a structure S is a triple of sets A ⊆ S ¯ x , B ⊆ S ¯ y and C ⊆ Swith | A | = m , | B | = n and | C | = m × n , such that the relation { ( ¯ a , ¯ b , c ) ∈ A × B × C | S | = ϕ ( ¯ a , ¯ b , c ) } is the graph of a bijection between A × B and C . More explicitly, for each ( ¯ a , ¯ b ) ∈ A × B thereis a unique c ∈ C such that S | = ϕ ( ¯ a , ¯ b , c ) , and conversely, for each c ∈ C there is a unique ( ¯ a , ¯ b ) ∈ A × B such that S | = ϕ ( ¯ a , ¯ b , c ) . Definition 4 (Defining large grids).
A class of structures C defines large grids if there is a formula ϕ ( ¯ x , ¯ y , z ) such that for all n ∈ N ϕ defines an n × n grid in some structure S ∈ C . Example 3.1.
Consider an m × n -semigrid as discussed in the introduction. It consists of m + I , . . . , I m of size n + I < . . . < I m . We show that there is a formula ϕ ( x , x ; y , y ; z ) which defines an m × n -grid in an m × n -semigrid G of a given type R ∈ { (cid:54) , (cid:62) , = , (cid:54) = } .The set A ⊆ G consists of the pairs ¯ a i = ( min I i , max I i ) of endpoints of the intervals I i , for i =
1, . . . , n . Suppose the semigrid has type = . Then we take B = I ⊆ G , C = I ∪ · · · ∪ I n , and ϕ ( x , x ; y ; z ) ≡ ( x (cid:54) z (cid:54) x ) ∧ E ( x , z ) . The reader is invited to check that this formula definesan n × ( n + ) -grid ( A , B , C ) .The case of a (cid:54) -semigrid is only slightly different. Note that in a (cid:54) -graph formed by twosets X and Y (cf. Fig. 1), the i th vertex y ∈ Y in the bottom can be characterized in terms of X by saying that it is adjacent to the i th vertex in X and non-adjacent to the ( i + ) st vertex in X .Because of this, we now take B ⊆ G to consist of pairs of consecutive elements of I , and for A and C as above, use the formula ψ ( x , x ; y , y ; z ) ≡ ( x (cid:54) z (cid:54) x ) ∧ ( E ( y , z ) ∧ ¬ E ( y , z )) .Then ψ defines an n × n -grid ( A , B , C ) .The cases of (cid:62) and (cid:54) = -semigrids are similar.The core of our proof is the following: Theorem 3.2. If C is a class of ordered binary structures which is not ( k , t ) -simple for any k , t ∈ N ,then some quantifier-free formula ϕ ( ¯ x , ¯ y , z ) defines large grids in C . This is proved using model-theoretic methods. In particular, we use compactness to con-struct an infinite ordered binary structure N which defines infinite grids. This is done in Sec-tions 8 and 9.Model-theoretic ideas are at the heart of our approach. We provide further characterisationsof bounded twin-width classes in terms of notions originating from model-theory in Section 8.In particular, some of the implications in Theorem 1.1 are stated and proved in much greatergenerality, for arbitrary classes of structures.Finally, we prove: 14 heorem 3.3.
Let C be a hereditary class of ordered binary structures. If C defines large grids using aquantifier-free formula, then C contains arbitrarily large regular n × n-semigrids. This uses a result from Ramsey theory to regularize the obtained grids. It crucially relies onthe grids being defined by a quantifier-free formula. This is proved in Section 5.As a consequence of our proof, we obtain Theorem 1.3, yielding a polynomial-time approx-imation algorithm for the twin-width of a given ordered binary structure. This in turn yieldsCorollary 7.2, about fixed-parameter tractability of model-checking of first-order logic on or-dered structures of bounded twin-width. This is shown in Section 7.From here, it is all downhill. The following result is relatively straightforward.
Proposition 3.4.
Let C be a hereditary class of ordered graphs which contains arbitrarily large regularn × n-semigrids. Then:– C interprets the class of all graphs,– model-checking first-order logic on C is as hard as on the class of all graphs,– C contains at least (cid:98) n (cid:99) ! non-isomorphic structures with n vertices. Conversely, by the results of [BKTW20a] and [BGK + ] classes of ordered graphs of boundedtwin-width:– are preserved under transductions,– have at most 2 O ( n ) structures of size n , up to isomorphism,This closes the loop (cf. Fig. 3) and proves the equivalence of all the notions consideredabove, yielding our first main result, Theorem 1.1.Our second main result, Theorem 1.2, applies to arbitrary classes of structures, not necessar-ily finite, ordered or binary. Similarly as above, at its core is a suitable grid theorem. We definea notion regular classes C , which generalizes the notion of ( k , t ) -simple classes above to arbi-trary structures. We then show that if a class C is not regular then it defines large grids. This isproved in Section 8, alongside with Theorem 3.2. In the process, we exhibit various propertiesof monadically NIP classes of structures, in particular, that they are . In this section, we define the notion of regular semigrids, and prove that they exhibit bad be-haviour, proving Proposition 3.4. In particular, they do not have bounded twin-width.We start with defining regular semigrids. The definition below applies only to orderedgraphs, rather than to ordered binary structures. The complete definition of regular semigridsfor ordered binary structures is deferred to Section 5. Proposition 3.4 will be easily lifted toarbitrary binary signatures (cf. Corollary 5.8).Fix an m × n -semigrid consisting of disjoint intervals I , . . . , I m of length n + I < . . . < I m . It will be convenient to identify the elements of the m × n semigrid with thepoints in [ m + ] × [ n + ] so that for each i ∈ [ m + ] , the elements of I i are identified withthe elements in the i th row { i } × [ n + ] in increasing order (that is, the smallest element in I i isidentified with ( i , 0 ) , the second smallest with ( i , 1 ) , etc.). In other words, the intervals I , . . . , I m ( m + ) × ( n + ) matrix by putting I in the first row, I in the next one, andso on. Note that the order (cid:54) on I ∪ · · · ∪ I m (with the interval I omitted) agrees with thelexicographic order on {
1, . . . , m } × {
0, . . . , n } . For p , q ∈ I ∪ · · · ∪ I m , with p = ( i , j ) in the i throw and j th column and q = ( i (cid:48) , j (cid:48) ) in the i (cid:48) th row and j (cid:48) th column, and p < q lexicographically,let dir ( p , q ) ∈ {→ , ↓ , (cid:38) , (cid:46)} be equal to: → if i = i (cid:48) , j < j (cid:48) , ↓ if j = j (cid:48) , i < i (cid:48) , (cid:38) if i < i (cid:48) , j > j (cid:48) , (cid:46) if i < i (cid:48) , j (cid:48) < j (cid:48) .An m × n -semigrid is regular if:1. I < I < . . . < I m or I < . . . < I m < I ,2. I forms a clique or an independent set, and3. for p , q ∈ I ∪ · · · ∪ I n with p < q , the adjacency between p and q depends only dir ( p , q ) .A scheme of a semigrid consists of: the type R ∈ { (cid:54) , (cid:62) , (cid:54) = , = } , a parameter S ∈ { < , > } corre-sponding to the choice (1) above, a parameter T ∈ { clique, independent } corresponding to thechoice (2) above, and a subset X ⊆ {→ , ↓ , (cid:46) , (cid:38)} corresponding to the choices (3) above, wherea pair p , q with p < q is adjacent if and only if dir ( p , q ) ∈ X . Denote bySchemes = { (cid:54) , (cid:62) , (cid:54) = , = } × { < , > } × { clique, independent } × {→ , ↓ , (cid:46) , (cid:38)} the set of all possible schemes, so | Schemes | = . For each σ ∈ Schemes, let R σ denote theclass of all regular m × n semigrids conforming to σ , for all m , n ∈ N .Note that a regular m × n -semigrid G ∈ R σ contains as induced substructures every regular m (cid:48) × n (cid:48) -semigird G (cid:48) ∈ R σ , for all m (cid:48) (cid:54) m and n (cid:48) (cid:54) n (by removing some rows and columns of G ), so if a hereditary class C contains arbitrarily large regular n × n -semigrids then C ⊇ R σ forsome σ ∈ Schemes.The definition of regular semigrids is generalized to arbitrary binary structures in Section 5.Proposition 3.4 is restated below.
Proposition 4.1.
Let C be a hereditary class of ordered graphs. If C contains arbitrarily large regularsemigrids then:1. C interprets the class of all graphs,2. model-checking first-order logic on C is AW[ ∗ ]-hard,3. C contains at least (cid:98) n (cid:99) ! non-isomorphic structures with n elements.Proof. Fix any σ ∈ Schemes such that C contains R σ . Without loss of generality we may assumethat σ imposes an independent set on I (otherwise we replace edges by non-edges in all graphsin C and replacing ‘clique’ by ‘independent’ in σ ). Also without loss of generality we mayassume that σ imposes I < I (otherwise reverse the order in all structures in C and replace < by > in σ ).Fix a semigrid G ∈ R σ ; recall that its elements are identified with [ m + ] × [ n + ] . Let ∗ =(
0, 0 ) denote the smallest element in G . This is also the smallest element of I , by the assumptionabove. Let R = { min I , . . . , min I m } = { (
1, 0 ) , (
2, 0 ) , . . . , ( m , 0 ) } be the set of smallest elementsof each of the intervals I , . . . , I m ( I is omitted). Those elements represent the rows of M = {
1, . . . , m } × {
1, . . . , n } . Let C = { (
0, 1 ) , . . . , ( n ) } = I − {∗} ; those elements represent thecolumns of M . 16or a given S ⊆ M , denote by G S the ordered subgraph of G induced by {∗} ∪ C ∪ R ∪ S .The following is immediate. Claim 4.1.
There is a polynomial-time algorithm which inputs numbers m , n ∈ N , a relation S ⊆{
1, . . . , m } × {
1, . . . , n } and in polynomial time outputs the ordered graph G S ∈ R σ . This will be the basis of our reduction from the model-checking problem over the class ofarbitrary binary relations to that over C .We now show how to interpret the binary relation S in G S by a first-order formula. Thefollowing lemma is proved by a simple case analysis, depending on σ ∈ Schemes.
Lemma 4.2.
There are first-order formulas ϕ C ( x ) , ϕ R ( x ) , π ( x , y ) , π ( x , y ) , ρ ( x , y ) such that for everym × n-semigrid G ∈ R σ and S ⊆ {
1, . . . , m } × {
1, . . . , n } : ϕ C ( G S ) = C ⊆ G S , ϕ R ( G S ) = R ⊆ G S , π ( G S ) = { (( i , j ) , ( i , 0 )) | ( i , j ) ∈ S } ⊆ S × R ⊆ G S × G S π ( G S ) = { (( i , j ) , ( j )) | ( i , j ) ∈ S } ⊆ S × C ⊆ G S × G S ρ ( G S ) = { (( i , 0 ) , ( j )) | ( i , j ) ∈ S } ⊆ R × C ⊆ G S × G S . In words, π and π define the graphs of the two projections from S ⊆ {
1, . . . , m } × {
1, . . . , n } onto R (cid:39) {
1, . . . , m } and C (cid:39) {
1, . . . , n } , while ρ defines the relation S ⊆ {
1, . . . , m } × {
1, . . . , n } as arelation on R × C .Proof. If σ specifies a type among (cid:54) , (cid:62) , = , then C is the open interval between ∗ and the smallestneighbor of ∗ . If σ specifies the type (cid:54) = , then C is the open interval between ∗ and the smallestneighbor of the successor of ∗ . In either case, C can be described by a first-order formula ϕ C ( x ) not depending on m , n ∈ N and S .If σ specifies the type = or (cid:62) , then R is the set of neighbors of ∗ . If σ specifies the type (cid:54) then R is the neighborhood of ∗ minus the neighborhood of the successor of ∗ . Finally, if σ specifies the type (cid:54) = then R is the complement of C ∪ {∗} ∪ N ( ∗ ) (the set of neighbors of ∗ ). Inall cases, R can be described by a first-order formula ψ R ( x ) not depending on m , n and S .Note that an element p ∈ S lies in the i th row if and only if ( i , 0 ) < p < ( i +
1, 0 ) , which canbe expressed by a first-order formula. More precisely, consider the first-order formula π ( x , y ) which holds if and only if y ∈ R , and y < x < y (cid:48) where y (cid:48) is the least y (cid:48) ∈ R with y > y (cid:48) (unlessno such y (cid:48) exists, then just take y < x ). Then π ( p , q ) holds if and only if p and q are in the samerow and p ∈ R , defining the required relation.Dually, we can define that an element in S is in a column c ∈ C . Namely, let π ( x , y ) be thefirst-order formula expressing that y ∈ C , and: (case = ) x is a neighbor of y , (case (cid:54) = ) x is a non-neighbor of y , (case (cid:54) ) y is a neighbor of x but not of the predecessor of x , (case (cid:62) ) x is a neighbor y but not of the predecessor of y .Finally, the formula ρ ( x , y ) expresses that x ∈ R , y ∈ C and there exists z such that π ( z , x ) and π ( z , y ) hold. 17et B be the class of all finite, ordered bipartite graphs H = ( V ∪ V , E , (cid:54) , (cid:54) ) with parts V and V , where V is totally ordered by (cid:54) and V is totally ordered by (cid:54) , and E ⊆ V × V . Lemma 4.3.
There is an interpretation I σ such that I σ ( C ) = B for every hereditary class of orderedgraphs C containing R σ . More precisely, for S ⊆ {
1, . . . , m } × {
1, . . . , n } , the structure I σ ( G S ) is thebipartite graph with parts R = {
1, . . . , m } and C = {
1, . . . , n } , each ordered by (cid:54) , where i ∈ R andj ∈ C are adjacent if and only if ( i , j ) ∈ S.Proof. I σ consists of:– the the domain formula δ ( x ) ≡ ϕ R ( x ) ∨ ϕ C ( x ) defining the domain R ∪ C ,– the formula ϕ E ( x , y ) ≡ ρ ( x , y ) defining the edge relation E ,– the formula ϕ R ( x ) ∧ ϕ R ( y ) ∧ x (cid:54) y defining the order (cid:54) on R , and– the formula ϕ C ( x ) ∧ ϕ C ( y ) ∧ x (cid:54) y defining the order (cid:54) on C .The statement follows from Lemma 4.2.As the class of all graphs interprets in the class of all bipartite graphs via some first-order in-terpretation T , the interpretation I σ can be further composed with T obtaining an interpretation T ◦ T σ such that ( T ◦ T σ )( C ) is the class of all finite graphs. This proves (1).This also gives a polynomial-time reduction of the model-checking problem on the class ofbipartite graphs to the model-checking problem on C : a sentence ψ holds in a bipartite graph H = ( V , V , E ) with V = {
1, . . . , m } , V = {
1, . . . , n } if and only if the sentence obtained from ψ by replacing each atom E ( x , y ) by ρ ( x , y ) holds in the structure G S , where G ∈ R σ is the m × n -semigrid and S = E ∩ ( V × V ) . As G S can be computed in polynomial time given H (cf. Claim 4.1), this yields the required polynomial-time reduction. Since model-checking first-order logic on the class of all bipartite graphs is AW[ ∗ ]-hard [FG06], this yields the same lowerbound for C , proving (2).We now prove (3). For a k × l matrix M ∈ {
0, 1 } k × l with 0-1 entries let | M | denote k + l plusthe number of nonzero entries in M . For n ∈ N define f ( n ) = max {| M | | k , l ∈ N , M ∈ {
0, 1 } k × l } .It is easy to see that f ( n ) (cid:62) (cid:98) n (cid:99) !. Indeed: for n = k consider a k × k permutation matrix M ,having exactly one nonzero entry in each row and each column. Then | M | = n , and there areexactly k ! such matrices.This bound can be easily improved: instead of permutation matrices we can consider all k × k matrices with exactly one nonzero entry in each column, yielding f ( n ) (cid:62) k k for n = k .Further, taking all k × k matrices with exactly k nonzero entries yields f ( n ) (cid:62) ( k k ) for n = k . Weexpect those lower bounds can be improved further. We use the first lower bound as it yieldsthe simplest expression among the three. Lemma 4.4. C contains at least f ( n ) non-isomorphic structures with n vertices, for each n ∈ N .Proof. For all k , l ∈ N and matrix M ∈ {
0, 1 } k , l , consider the k × l -regular semigrid G ∈ R σ and denote by F ( k , l , M ) the ordered graph G S ∈ C as constructed above for S being the set ofnon-zero entries in M : S = { ( i , j ) | (cid:54) i (cid:54) k , 1 (cid:54) j (cid:54) l , M ij = } .18t follows from the above that F maps distinct matrices to non-isomorphic structures in C .Indeed: for the transduction T defined above, T ( F ( m , n , M )) uniquely determines m , n and M .This proves the lemma.This completes the proof of Proposition 4.1, and hence Proposition 3.4. (See Corollary 5.8below for a generalization to arbitrary binary signatures). Corollary 4.5. C has unbounded twin-width.Proof. If C has bounded twin-width then it does not interpret the class of all graphs [BKTW20a]and is small [BGK + ]. In this section we prove Theorem 3.3, which we recall below, generalized to arbitrary binarysignatures Σ : Theorem 5.1.
Let C be a hereditary class of ordered binary structures graphs. If C defines large gridsusing a quantifier-free formula, then C contains arbitrarily large regular n × n-semigrids. In particular, we need to define the notion of a regular semigrid for an arbitrary binarysignature Σ .Before doing this, we introduce the relevant result from Ramsey theory. Let an ordered m × ngrid be the relational structure with domain [ m ] × [ n ] and two quasi-orders (cid:54) and (cid:54) , wheretwo points ( i , j ) , ( i (cid:48) , j (cid:48) ) are related by (cid:54) if and only if i (cid:54) i (cid:48) and are related by (cid:54) if and onlyif j (cid:54) j (cid:48) . A pair coloring of such an ordered m × n grid is a function c : ([ m ] × [ n ]) → Γ to afixed finite set Γ of colors . Such a coloring is homogeneous if the color c ( p , q ) depends only on theatomic type of the pair ( p , q ) . In other words, the color of a pair ( p , q ) depends only on whether p = q , and if not, on the quadrant or principle semi-axis in Z to which the vector p − q belongsto. There are 9 possible types, corresponding to the pairs in { < , = , > } describing the relationsbetween p and q in each of the two dimensions.The following result is a special case of the so-called product Ramsey theorem (see e.g. Propo-sition 3 in [Bod15] in the special case of the full product of two copies of ( Q , (cid:54) ) . See also thehistorical comment following it). Lemma 5.2.
Fix a finite set of colors Γ . For every m , n there are m (cid:48) , n (cid:48) such that for every coloring c ofthe ordered m (cid:48) × n (cid:48) there is an induced substructure isomorphic to the m × n grid for which the coloringinduced by c is homogeneous. Fix a formula ϕ ( ¯ x , ¯ y , z ) , an ordered structure S and an m × n grid ( A , B , C ) defined by ϕ in S.The sets A ⊆ S ¯ x and B ⊆ S ¯ y are ordered lexicographically with respect to the order on S, andsome fixed enumeration of the tuples ¯ x and ¯ y . Those two orders induce two quasi-orders (cid:54) , (cid:54) on C , via the bijection α : A × B → C defined by the formula ϕ . Namely, α ( ¯ a , ¯ b ) (cid:54) α ( ¯ a (cid:48) , ¯ b (cid:48) ) ifand only if ¯ a (cid:54) lex ¯ a (cid:48) and α ( ¯ a , ¯ b ) (cid:54) α ( ¯ a (cid:48) , ¯ b (cid:48) ) if and only if ¯ b (cid:54) lex ¯ b (cid:48) .Say that the grid ( A , B , C ) is homogeneous if for every ( ¯ a , ¯ b ) , ( ¯ a (cid:48) , ¯ b (cid:48) ) ∈ A × B ⊆ S ¯ x ¯ y the atomictype of ( ¯ a , ¯ b , ¯ a (cid:48) , ¯ b (cid:48) , α ( ¯ a , ¯ b ) , α ( ¯ a (cid:48) , ¯ b (cid:48) )) in S depends only on the atomic type of ( α ( ¯ a , ¯ b ) , α ( ¯ a (cid:48) , ¯ b (cid:48) )) in ( C , (cid:54) , (cid:54) ) . Lemma 5.3.
Fix a finite signature Σ containing (cid:54) and a Σ -formula ϕ ( ¯ x , ¯ y , z ) . For every m , n there arem (cid:48) , n (cid:48) such that if ϕ defines an m (cid:48) × n (cid:48) grid in an ordered Σ -structure S then ϕ also defines an m × nhomogeneous grid in S . roof. Let Γ be the set of atomic Σ -types of tuples of length 2 ( | ¯ x | + | ¯ y | + ) . Apply Lemma 5.2yielding numbers m (cid:48) , n (cid:48) .Suppose ϕ defines an m (cid:48) × n (cid:48) grid ( A , B , C ) in S, and let α : A × B → C be the bijectiondefined by ϕ . Consider C with the two orders (cid:54) and (cid:54) as described earlier, then ( C , (cid:54) , (cid:54) ) is isomorphic to the ordered m (cid:48) × n (cid:48) grid. Color each pair ( α ( ¯ a , ¯ b ) , α ( ¯ a (cid:48) , ¯ b (cid:48) )) ∈ C by the atomictype of the tuple ( ¯ a , ¯ b , ¯ a (cid:48) , ¯ b (cid:48) , α ( ¯ a , ¯ b ) , α ( ¯ a (cid:48) , ¯ b (cid:48) )) in S.By Lemma 5.2, ( C , (cid:54) , (cid:54) ) contains a copy C (cid:48) ⊆ C of a homogeneous ordered m × n -grid.Then α − ( C (cid:48) ) ⊆ A × B and C (cid:48) form a homogeneous m × n grid defined by ϕ .We now generalize the notion of a regular semigrid from Section 4 to an arbitrary relationalbinary signature Σ containing the order symbol (cid:54) .Fix m , n ∈ N and consider the ordered grid ( m + ) × ( n + ) -grid ( C , (cid:54) , (cid:54) ) with domain C = [ m + ] × [ n + ] as described above. Let B = [ ] × [ n + ] ⊆ C , and let π : C → B be theprojection mapping ( i , j ) ∈ C to ( j ) .A regular m × n-semigrid is an ordered Σ -structure S with domain C such that the order (cid:54) ofS agrees with the natural lexicographic order on C = [ m + ] × [ n + ] or its inverse, and for all a , b ∈ B and p , q ∈ C − B :1. the atomic type of ( a , b ) in S depends only on the atomic type of ( a , b ) in ( B , (cid:54) ) ;2. the atomic type of ( p , q ) in S depends only on the atomic type of ( p , q ) in ( C , (cid:54) , (cid:54) ) ;3. the atomic type of ( p , b ) in S depends only on the atomic type of ( π ( p ) , b ) in ( B , (cid:54) ) , andis non-constant.A regular semigrid is completely specified by the dimensions m × n , the information ( < or > )about whether or not to reverse the lexicographic order, as well as a tuple of functions describingthe dependencies as above. For example, the dependencies (1) and (3) above are each specifiedby a function from { < , = , > } to the set T of atomic Σ -types of pairs, whereas the dependency (2)is specified by a function from { < , = , > } to T . In total, all the dependencies are described by atuple in T + + = T (with some tuples being excluded due to the non-constant requirement,and some being unsatisfiable in an ordered structure). Let Schemes = { < , > } × T denote theset of possible choices, called schemes .As | T | (cid:54) | Σ | , we get the following. Lemma 5.4.
For every n (cid:62) there are at most O ( | Σ | ) distinct regular n × n-semigrids, and they canbe enumerated in time O ( | Σ | ) · poly ( n ) . Lemma 5.5.
Assume Σ = { E , (cid:54) } consists only of the edge symbol E and order symbol (cid:54) . Then anordered graph is a regular semigrid in the sense of Section 4 if and only if it is a regular semigrid asdefined above.Proof sketch. In one direction, suppose G is a regular semigrid in the sense of Section 4 withintervals I , . . . , I m of size n +
1, and assume I < I < . . . < I m (in the other case reverse theorder of G ). Arrange I , . . . , I m in a grid C = [ m + ] × [ n + ] by placing I in the first row, I in the second, etc. Then the order of G on I ∪ . . . ∪ I m agrees with the lexicographic order on C = [ m + ] × [ n + ] , and the conditions (1)-(3) in the definition above hold.The other direction is similar. Lemma 5.6.
For any class C of ordered Σ -structures which contains arbitrarily large n × n-semigridsthere is a quantifier-free interpretation I : Σ → { E , (cid:54) } such that I ( C ) is a class of ordered graphscontaining arbitrarily large regular n × n-semigrids. roof sketch. We use the notation from the definition of regular semigrids above. Fix σ ∈ Schemessuch that there are arbitrarily large n × n -semigrids in C conforming to σ . Then σ specifies thatthe atomic type of ( p , q ) in S depends in the same way on the atomic type of ( π ( p ) , b ) in ( B , (cid:54) ) ;in particular, this dependency is non-constant. Hence there are two distinct atomic types τ , τ which are realized as atomic types of pairs of the form ( π ( p ) , b ) for b ∈ B , p ∈ C − B .The interpretation I is the interpretation with domain formula δ ( x ) = ( x = x ) , order for-mula ϕ (cid:54) ( x , y ) = ( x (cid:54) y ) and edge formula ϕ E ( x , y ) = τ ( x , y ) ∨ τ ( y , x ) .If S is a regular m × n -semigrid of scheme σ then I ( S ) is a regular m × n -semigrid which isan ordered graph. Indeed, since I is quantifier-free, the atomic type of ( x , y ) in I ( S ) dependsonly on the atomic type of ( x , y ) in S, and hence the conditions in the definition of regularity aremet. The non-constancy condition is also satisfied by the choice of τ (cid:54) = τ .We now exhibit large regular semigrids in any class in which some quantifier-free formuladefines large grids. Proposition 5.7.
Let C be a hereditary class of ordered structures over a finite binary signature Σ andlet ϕ ( ¯ x , ¯ y , z ) be a quantifier-free formula which defines large grids in C . Then C contains arbitrarilylarge regular n × n-semigrids.Proof. Fix a number n . By Lemma 5.3 ϕ defines a homogeneous ( n + ) × ( n + ) grid ( A , B , C ) in some structure S ∈ C . In particular, the atomic type atp ( ¯ a , ¯ b ) does not depend on the choiceof ¯ a ∈ A and ¯ b ∈ B .As in the definition of homogeneity of the grid ( A , B , C ) , order A ⊆ S ¯ x and B ⊆ S ¯ y lexico-graphically with respect to the order (cid:54) on S and the fixed enumeration of ¯ x and ¯ y . Let (cid:54) A and (cid:54) B be the resulting orders of A and B . This induces, via the bijection α : A × B → C defined by ϕ , eight possible lexicographic orders on C :– we may either order A using (cid:54) A or its inverse (cid:62) A ,– we may either order B using (cid:54) B or its inverse (cid:62) B ,– we may then order C (cid:39) A × B lexicographically using first the chosen order on A thenthe chosen order on B , or the other way around. Claim 5.1.
The order (cid:54) on C coincides with one of the orders above.Proof. For ¯ a ∈ A , ¯ b ∈ B denote [ ¯ a , ¯ b ] : = α ( ¯ a , ¯ b ) . Pick points ¯ a < A ¯ a (cid:48) ∈ A and ¯ b < B ¯ b (cid:48) < B b (cid:48)(cid:48) ∈ B .Assume [ ¯ a , ¯ b ] < [ ¯ a , ¯ b (cid:48) ] ; otherwise replace (cid:54) B with (cid:62) B in the following. Assume [ ¯ a , ¯ b (cid:48) ] < [ ¯ a , ¯ b (cid:48) ] ;otherwise replace (cid:54) A with (cid:62) A in the following.Let C (cid:48) = { [ ¯ a , ¯ b ] , [ ¯ a , ¯ b (cid:48) ] , [ ¯ a , ¯ b (cid:48)(cid:48) ] , [ ¯ a (cid:48) , ¯ b (cid:48) ] } ⊆ C ⊆ A × B .Compare [ ¯ a (cid:48) , ¯ b (cid:48) ] with [ ¯ a , ¯ b (cid:48)(cid:48) ] . If [ ¯ a (cid:48) , ¯ b (cid:48) ] < [ ¯ a , ¯ b (cid:48)(cid:48) ] then (cid:54) coincides on C (cid:48) with the lexicographicorder which first orders according to (cid:54) B and then according to (cid:54) A . Otherwise, if [ ¯ a , ¯ b (cid:48)(cid:48) ] < [ ¯ a (cid:48) , ¯ b (cid:48) ] then (cid:54) coincides on C (cid:48) ⊆ C (cid:39) A × B with the lexicographic order which first orders accordingto (cid:54) A and then according to (cid:54) B . Let (cid:54) lex denote this among those two lexicographic orderswhich agrees with (cid:54) on C (cid:48) .By construction of C (cid:48) , for every pair of points c = [ ¯ a , ¯ b ] , c = [ ¯ a , ¯ b ] in C , there is a pair c (cid:48) , c (cid:48) in C (cid:48) such that [ c (cid:48) , c (cid:48) ] and [ c , c ] have equal atomic types in ( C , (cid:54) , (cid:54) ) . It follows fromhomogeneity that (cid:54) agrees of (cid:54) lex on all of C . 21uppose that the order (cid:54) on C coincides with one of the four lexicographic orders where A has higher priority than B (otherwise replace B and A in the argument), and the projectionfrom C (cid:39) A × B to A is monotone rather than anti-monotone (otherwise replace (cid:54) with (cid:62) inthe argument).Pick points ¯ a < ¯ a (cid:48) in A and ¯ b < ¯ b (cid:48) in B and let c = [ ¯ a , ¯ b ] ∈ C , so that ϕ ( ¯ a , ¯ b , c ) holds. Claim 5.2. atp ( ¯ b , c ) (cid:54) = atp ( ¯ b (cid:48) , c ) .Proof. Note that atp ( ¯ a , ¯ b ) = atp ( ¯ a , ¯ b (cid:48) ) by homogeneity. If atp ( ¯ b , c ) = atp ( ¯ b (cid:48) , c ) then we wouldhave atp ( ¯ a , ¯ b , c ) = atp ( ¯ a , ¯ b (cid:48) , c ) since the signature is binary. This is a contradiction since ϕ isquantifier-free and holds of ( ¯ a , ¯ b , c ) but not of ( ¯ a , ¯ b (cid:48) , c ) .As Σ is binary, there is a variable y ∈ ¯ y such that atp ( ¯ b ( y ) , c ) (cid:54) = atp ( ¯ b (cid:48) ( y ) , c ) . Let B (cid:48) = π y ( B ) ⊆ S be the projection of B ⊆ S ¯ y onto the y -component of ¯ y .It is now straightforward to verify that the substructure of S induced by C ∪ B (cid:48) is (isomorphicto) a regular ( n + ) × n -semigrid. In particular, it contains a regular n × n -semigrid as aninduced substructure. Corollary 5.8. If C is a hereditary class of ordered Σ -structures containing arbitrarily large regularn × n-semigrids then:– C interprets all graphs,– C is not small,– model-checking first-order logic is AW[ ∗ ]-hard on C ,– C has unbounded twin-width.Proof. Let I be the quantifier-free interpretation from Lemma 5.6. Then I ( C ) is a class of or-dered graphs that contains arbitrarily large semigrids, hence satisfies the above conditions byProposition 4.1. This implies the same properties for C . ( k , t ) -simplicity In this section we prove Theorem 3.1, which is repeated below:
Theorem (3.1) . Every ( k , t ) -simple finite ordered binary structure has twin-width O ( kt ) . We follow the general scheme of the proof of the implication (2) → (1) in Fact 1, presentedin [BKTW20b, Section 5].Instead of working with binary structures, we will consider their adjacency matrices. Anordered Σ -structure S induces a square matrix, called the adjacency matrix of S, whose rows andcolumns correspond to the elements of S, and where the entry at ( a , b ) is the atomic type atp ( ab ) .In the case of ordered graphs, there are five possible atomic types, depending on whether a = b , a < b or a > b , and on the adjacency between a and b . All matrices below have ordered setsof rows and columns. Definition 5 ( ( k , t ) -mixed minor). Fix k , t ∈ N . A ( k , t ) -mixed minor in a matrix M is a convexpartition R of its rows and a convex partition C of its columns, each with t parts, such that forall R ∈ R and C ∈ L , the submatrix M [ R × C ] of M has at least k different columns or at least k different columns. 22ote that if a class C is ( k + t ) -simple then the adjacency matrix of every S ∈ C has no ( k , t ) -mixed minor.We will use the following result due to Marcus and Tardos, concerning a related notion, of grid minors in 0-1 matrices with many 1’s. Definition 6 (grid minor). A t-grid minor in a 0-1 matrix M is a convex partition R of its rowsand a convex partition C of its columns, each with t parts, such that for all R ∈ R and C ∈ C ,the submatrix M [ R × C ] has an entry 1. Theorem 6.1. [MT04] For every t ∈ N there is a constant c t such that every m × n - matrix M withat least c t · max ( m , n ) entries has a t-grid minor. It is known [CK16] that c t = O ( t ) .A row interval R and a column interval C are homogeneous if the submatrix M [ R × C ] of M has all entries equal to each other. We will consider pairs consisting of a convex partition R ofthe rows and of a convex partition C of the columns. Such a pair ( R , C ) has red-degree at most d if for each row part R ∈ R there are at most d column parts C ∈ C such that R and C are nothomogeneous, and symmetrically, for each column part C ∈ C there are at most d row parts R ∈ R such that R and C are not homogeneous.We prove the following, asymmetric variant of Theorem 3.1. Proposition 6.2.
Fix k and t ∈ N . There is a constant d = O ( tk ) such that for every rectangularmatrix M with no ( k , t ) -mixed minor there is a sequence ( R , C ) , ( R , C ) , . . . , ( R l , C l ) (1) of pairs of partitions (of the rows and columns of M, respectively) that is maximal under refinement, andconsists of pairs of red-degree at most d. Here, maximality under refinement means:– R and C are both partitions into singletons,– R l and C l are both partitions with one part, and– if 1 (cid:54) i < l then ( R i + , C i + ) either R i + is obtained by merging two parts in R i into oneand leaving C i + = C i , or vice-versa.Note that the partitions in Proposition 6.2 are not necessarily convex.We proceed to the proof of Proposition 6.2. For the rest of Section 6, fix constants k and t and a matrix M with no ( k , t ) -mixed minor. We proceed in two steps. The first step is:
Lemma 6.3.
There are constants b = c tk and c = k c tk depending on k and t only such M has a maximal(under refinement) sequence ( R , C ) , ( R , C ) , . . . , ( R l , C l ) (2) of pairs of convex partitions of the rows and columns of M such that the following conditions hold for (cid:54) i (cid:54) l:– for each row interval R ∈ R i there is a set B ⊆ C i of at most b column intervals such that M hasat most c distinct rows in R × (cid:83) ( C i − B ) , and symmetrically for columns and rows exchanged. To construct the sequence (2), we start with the partitions R and C of the rows and columnsinto singletons, and then proceed by repeatedly merging either two adjacent parts of the rowpartition or of the column partition so that the condition in the lemma above is maintained.This is done in a greedy way, and we show that if the process is blocked at some point, then M must have a ( k , t ) -mixed minor, by the Marcus-Tardos result.The key lemma is: Lemma 6.4.
Let R be a convex partition of the rows and C be a convex partition of the columns of M,such that |R| (cid:62) |C| . Then for some row interval R ∈ R there is a set B ⊆ C of at most c tk columnintervals such that M has at most k c tk distinct rows in R × (cid:83) ( C − B ) .Proof. Fix a row interval R ∈ R . A minimal bad interval for R is an inclusion-minimal intervalof columns I such that M [ R × I ] contains at least k distinct rows. The first column in a minimalbad interval for R is a bad column for R .Consider the R × C matrix N whose ( R , C ) -entry is 1 if C contains a bad column for R , and0 otherwise. By the Marcus-Tardos theorem, at least one of the following holds:( a ) some row R ∈ R in N has less than 2 c tk many 1’s, or( b ) N has a tk -grid minor.Assume case ( a ) holds. Let B ⊆ C be the set of columns C such that the ( R , C ) -entry is a 1.By assumption, | B | < c tk . Consider a maximal interval in I ⊆ C not containing an elementof B . Then I does not contain a minimal bad interval for R . In particular, M [ R × I ] has fewerthan k distinct rows. Since | B | < c tk , there are at most 2 c tk such intervals I . It follows that M [ R × ( (cid:83) C − B )] has fewer than k c tk distinct rows, yielding the conclusion of the lemma. Itremains to prove that case ( b ) cannot hold.We show that case ( b ) would yield a ( k , t ) -mixed minor in M , contrary to the assumption.Assume that N has a tk -grid minor. This minor corresponds to a convex coarsening R (cid:48) of R and a convex coarsening C (cid:48) of C such that for all R ∈ R (cid:48) and C ∈ C (cid:48) , a bad column for R can befound in C . Moreover, C (cid:48) and R (cid:48) have tk parts each.Let C (cid:48)(cid:48) be the coarsening of C (cid:48) obtained by grouping parts of C (cid:48) by groups of size k , so thateach interval in C (cid:48)(cid:48) is a union of k intervals in C (cid:48) . Then C (cid:48)(cid:48) has t parts.Fix a row interval R ∈ R (cid:48) and a column interval C ∈ C (cid:48)(cid:48) . We claim that M [ R × C ] has at least k different columns.By definition of C (cid:48)(cid:48) , there are k columns c < . . . < c k in C such that for each 1 (cid:54) i (cid:54) k ,column c i is bad for some row interval R i ∈ R that is contained in R . Let I i be the correspondingbad interval that starts at column c i . If some I i is contained in C then we are done, since I i witnesses that M [ R i × I i ] has at least k different columns, so even more so M [ R × C ] .Otherwise, every interval I i starts at c i ∈ C and extends beyond C . We claim that then thecolumns c , . . . , c k of M [ R × C ] are pairwise distinct. To this end, pick 1 (cid:54) i < j (cid:54) k ; we showthat the columns c i and c j differ already within M [ R i × C ] .Note that c j ∈ I i since I i starts at c i and extends beyond C , whereas c i < c j ∈ C . Since I i is aminimal bad interval for R i , the columns c i and c j of M [ R i × C ] differ – otherwise M [ R i × ( I i −{ c i } )] would have the same set of columns as M [ R i × I i ] , contradicting minimality of I i .This proves that M [ R × C ] contains at least k distinct columns, for all R ∈ R (cid:48) and C ∈ C (cid:48)(cid:48) .Coarsening R (cid:48) by grouping by k parts, we get a convex partition R (cid:48)(cid:48) into t parts. The partitions24 (cid:48)(cid:48) and C (cid:48)(cid:48) witness that M has a ( k , t ) -mixed minor, contradicting the assumption. Hence, case( b ) cannot hold. Proof of Lemma 6.3.
We construct a sequence ( R , C ) , ( R , C ) , . . . , ( R i , C i ) of pairs of convexpartitions, satisfying the two conditions in the lemma, as follows. R is the partition of therows into singletons, and C is the partition of the columns into singletons. For i >
0, con-struct ( R i , C i ) from ( R i − , C i − ) as follows. Assume that |R i − | (cid:62) |C i − | , the other case beingsymmetric. Group the parts of R i − by two, yielding a partition R with 2 |R| (cid:62) |C i − | . ApplyLemma 6.4, yielding some row interval R ∈ R for which there is a set B ⊆ C i − of at most 2 c tk column intervals such that M has at most k c tk distinct rows in R × (cid:83) ( C i − − B ) . The row inter-val R ∈ R corresponds to two adjacent row intervals in R i − . Let R i be obtained from R i − by replacing those two adjacent row intervals by their union R , and let C i = C i − . The aboveconstruction terminates once both R i and C i have one part each.In the second step, we improve the sequence (2), yielding a sequence of pairs of not neces-sarily convex partitions with the properties described in the following reformulation of Proposi-tion 6.2. Below, b = c tk and c = k c tk are the constants from Lemma 6.3. Lemma 6.5.
There is a maximal (under refinement) sequence ( R (cid:48)(cid:48) , C (cid:48)(cid:48) ) , ( R (cid:48)(cid:48) , C (cid:48)(cid:48) ) , . . . , ( R (cid:48)(cid:48) l , C (cid:48)(cid:48) l ) (3) of pairs of partitions of the rows and columns of M of red-degree at most d = bc .Proof. We start with the sequence (2) obtained from Lemma 6.3.Fix 0 (cid:54) i (cid:54) l and a row interval R ∈ R i . Let B ⊆ C i be as in the statement of Lemma 6.3,with | B | (cid:54) b = c tk . Then M has c = k c tk distinct rows in R × (cid:83) ( C i − B ) . Partition R into at most c parts, where two rows r , r (cid:48) ∈ R are in the same part if they coincide on each column in C i − B .By doing this for every row interval R , we obtain a refinement R (cid:48) i of R i , in which everyinterval in R i is partitioned into at most c parts in R (cid:48) i . We proceed symmetrically with thecolumns, yielding a refinement C (cid:48) i of C i .We show that the obtained sequence of pairs of partitions satisfies the conditions of Lemma 6.5,apart from being a maximal chain under refinement.By construction of R (cid:48) i and C (cid:48) i , we get: Claim 6.1.
For each row part R ∈ R (cid:48) i there is a set B (cid:48) ⊆ C (cid:48) i of at most t (cid:48) = b · c column parts such thatfor all C ∈ C (cid:48) i − B (cid:48) , all entries in M [ R , C ] are equal. Symmetrically for columns and rows exchanged. Say that a partition P is an r - coarsening of a partition P if every part of P is union of atmost r parts of P Claim 6.2. R (cid:48) i is a c-coarsening of R (cid:48) i − and C (cid:48) i is a c-coarsening of C (cid:48) i − . This claim, as well as the rest of the proof, proceed as in [BKTW20b, Proof of Theorem 10].In particular, applying Lemma 8 from there yields the sequence (3) of red-degree d = c · bc .Lemma 6.5 yields Proposition 6.2.To finish the proof of Theorem 3.1, we observe that the sequence (3) can be made so that thepartitions in each pair are equal, just as in [BKTW20b, Proof of Theorem 14].Observe that the construction above is effective, and yields the following: Corollary 6.6.
Fix a binary signature Σ . There is an algorithm which, given an ordered binary structure S and numbers k , t ∈ N , terminates in time polynomial in | S | with one of the following outcomes: either a contraction sequence of S of red-degree bounded by O ( kt ) , or– a ( k , t ) -mixed minor in the adjacency matrix of S . In this section we assume that we already know that every hereditary class C of binary struc-tures of unbounded twin-width contains arbitrarily large regular semigrids. This will be provedin the following sections using entirely different tools, but in this section we focus only on thealgorithmic application of this fact. We prove: Theorem 7.1 (1.3) . There is a computable function f : N → N and an algorithm which inputs anordered binary structure S , and computes in time polynomial in | S | a contraction sequence of S of red-degree at most f ( tww ( S )) . Corollary 7.2.
Fix a binary signature Σ . There is a computable function g : N × N → N , a constantc ∈ N and an algorithm which given a binary ordered structure S and a first-order sentence ϕ , deter-mines whether S | = ϕ in time g ( | ϕ | , tww ( S )) · | S | c . In other words, model-checking first-order logic isfixed-parameter tractable on ordered, binary structures, with the parameter being the formula ϕ and thetwin-width of the input structure.Proof. Follows from Theorem 1.3 and [BKTW20a, Theorem 1] according to which a there isan algorithm which given a first-order sentence ϕ and a binary structure S together with acontraction sequence of red-degree at most d determines if S | = ϕ in time h ( d , ϕ ) · | S | c , for somecomputable function h and constant c ∈ N .Fix an ordered binary structure S and define the following two parameters:– max-semigrid ( S ) : the maximal number n such that some regular n × n -semigrid is aninduced substructure of S,– simplicity ( S ) : the least number k such that S is ( k , k ) -simple.Clearly, both functions are computable.For two functions p , q mapping Σ -structures to numbers, write p (cid:52) q if there is a computablefunction α : N → N such that p ( S ) (cid:54) α ( q ( S )) for all finite ordered Σ -structures S. Lemma 7.3.
We have: tww (cid:52) simplicity (cid:52) max - semigrid (cid:52) tww . Proof.
The first inequality is by Theorem 3.1.We show the second inequality. Fix k ∈ N . Let F k denote the family of all minimal (underinduced substructure) structures S which are not ( k − k − ) -simple. In particular, every Swith simplicity ( S ) (cid:62) k contains at least one structure in F k as an induced substructure. Claim 7.1.
The family F k is finite (up to isomorphism) and its representatives are effectively computable,given k.Proof. A ( k , t ) -mixed minor in a matrix M is exhibited by a set R of at most kt rows and a set C of at most kt columns (in each of the t zones leave k distinct rows and k distinct columns).If M is the adjacency matrix of a binary ordered structure M, then the rows and columns are26ndexed by the same set M, so R ∪ C ⊆ M. Then the substructure of M induced by R ∪ C has a ( k , t ) -mixed minor and has size | M | (cid:54) kt .This shows that every structure that is not ( k , t ) -simple contains an induced substructure ofsize at most 2 kt which is not ( k , t ) -simple. Hence, the family of minimal structures that arenot ( k , t ) -simple is finite and can be effectively enumerated by checking all structures of size2 kt .Denote α ( k ) : = min { max-semigrid ( S ) | S ∈ F k } .The function α is computable by the claim above. By construction, if simplicity ( S ) = k then Shas some structure in F k as an induced substructure, and hence also some semigrid of size α ( k ) .This proves max-semigrid ( S ) (cid:62) α ( simplicity ( S )) . Hence, simplicity ( S ) (cid:54) α − ( max-semigrid ( S )) ,proving simplicity (cid:52) max-semigrid.Finally, we prove max-semigrid (cid:52) tww.By Lemma 4.3 and Lemma 5.6 there is a fixed transduction T such that for any regular k × k -semigrid K over the signature Σ , the set of outputs T ( K ) contains the set B k of all bipartitegraphs with two parts of size k The transduction T nondeterministically guesses a subset of agiven k × k -semigrid K corresponding to some set S ⊆ {
1, . . . , k } × {
1, . . . , k } and guesses thescheme σ (now in the signature of ordered graphs) and then applies the interpretation I fromLemma 5.6 (converting the regular semigrid over Σ to a graph semigrid) followed by I σ fromLemma 4.3, converting a regular k × k -semigrid G with a chosen set S ⊆ {
1, . . . , k } × {
1, . . . , k } into the bipartite graph corresponding to S .We can furthermore assume that T ( S (cid:48) ) ⊆ T ( S ) for any S and its induced substructure S (cid:48) , as T may first restrict the domain of the input structure using a unary predicate.By [BKTW20b, Theorem 39], there is a computable function β (depending on T ) such thattww ( T ( S )) (cid:54) β ( tww ( S )) (in the left-hand side T ( S ) is a set X of structures, so tww ( X ) = max S (cid:48) ∈ X tww ( S (cid:48) )) .Suppose max-semigrid ( S ) = k . Then S contains a k × k -regular semigrid K, so T ( S ) ⊇ B k and: β ( tww ( S )) (cid:62) tww ( T ( S )) (cid:62) tww ( B k ) = : γ ( k ) ,where γ ( k ) is a computable function which is unbounded, as the class of all bipartite graphshas unbounded twin-width.Hence k (cid:54) γ − ( β ( tww ( S ))) , proving max-semigrid (cid:52) tww.We now prove Theorem 1.3. Proof of Theorem 1.3.
Given a structure S, the algorithm proceeds as follows. For each k =
1, 2, . . . , n , run the algorithm from Corollary 6.6, until encountering the smallest number k forwhich the algorithm returns a contraction sequence of red-degree d = O ( k ) . This contrac-tion sequence is the result of our algorithm. We now provide an upper bound on d in terms oftww ( S ) .We have that simplicity ( S ) (cid:62) k , since the algorithm did not succeed for the value k −
1. Assimplicity (cid:52) tww, this shows that tww ( S ) (cid:62) α ( k ) for some computable function, and hence k (cid:54) α − ( tww ( S )) , and so d = O ( k ) is bounded by a computable function of tww ( S ) .27 Model-theoretic characterisations
In this section, we present our model-theoretic characterisations of classes of bounded twin-width, as well as prove more general results concerning arbitrary classes of structures. Amongothers, this will prove Theorem 3.2 and Theorem 1.2.We start with introducing the relevant notions from model theory.
Monadically NIP classes
A formula ϕ ( ¯ x , ¯ y ) defines in a structure S a bipartite graph withparts S ¯ x and S ¯ y , in which two tuples ¯ a ∈ S ¯ x and ¯ b ∈ S ¯ y are adjacent if ϕ ( ¯ a , ¯ b ) holds in S. Definition 7.
A class of structures C is NIP if for every formula ϕ ( ¯ x , ¯ y ) there is a finite bipartitegraph H which does not occur as an induced subgraph of ϕ ( S ) , for all S ∈ C .For example, the class of all cliques is NIP, whereas the class C of all finite graphs is not,since the edge formula E ( x , y ) may define arbitrary bipartite graphs in C . As another example,consider the class of all cliques with each edge subdivided: an additional vertex placed in themiddle of each edge. This class is NIP – intuitively, one cannot define much more in such agraph than in a usual clique. However, this changes if one can remove some of the newlyinserted vertices and the edges incident to them – this way, we can obtain any graph G witheach edge subdivided, and hence, very complex graphs can be obtained. The same is true ifinstead of removing the vertices, we can color some of the vertices by adding unary predicates,and use those predicates in the formulas. Definition 8 (Monadic NIP).
A class of structures C is monadically NIP if every expansion C (cid:48) of C by unary predicates is NIP (here C (cid:48) is such that every structure from S (cid:48) ∈ C (cid:48) is obtainedfrom some structure in S ∈ C by equipping S with arbitrarily many unary predicates).In particular, if C is monadically NIP then the hereditary closure of C is also monadicallyNIP, since removing vertices can be simulated by coloring them. The following fact essentiallysays that it is enough to consider formulas ϕ ( x , y ) with just two variables when consideringmonadic NIP. Definition 9 (Finitely monadically NIP).
A class of structures C is finitely monadically NIP ( fm-NIP ) if every expansion of C by finitely many unary predicates that are interpreted in structuresfrom C as finite sets is NIP.The following lemma is immediate. Lemma 8.1.
1. The class of all finite graphs is not NIP.2. A class of finite structures is monadically NIP if and only if it is fmNIP.
The following proposition is a restatement of a result of the first author [Sim21], see Ap-pendix A.5 for more details.
Proposition 8.2 ([Sim21]) . The following conditions are equivalent for a class of structures D :– D is not NIP,– there is a formula ϕ ( x , y ; ¯ z ) such that for every n there is a structure M ∈ D and a tuple ¯ c ∈ M ¯ z such that ϕ ( M; ¯ c ) ⊆ M defines a binary relation of VC-dimension at least n; Corollary 8.3.
The following conditions are equivalent for a class of structures C : . C does not transduce the class of all finite graphs;2. C is not monadically NIP. Corollary 8.3 also follows from results of Baldwin and Shelah [BS85].Together with Fact 2 this gives:
Corollary 8.4.
Every class of bounded twin-width is monadically NIP.
Finitely monadically NIP classes do not define large grids (cf. Def. 4):
Lemma 8.5. If C is fmNIP then C does not define large grids.Proof. Observe that if ϕ ( ¯ x , ¯ y , z ) defines a grid ( A , B , C ) in a structure S then for every binaryrelation R ⊆ A × B there is a unary predicate U ⊆ C such that the formula ψ ( ¯ x , ¯ y ) : = ∃ z . ϕ ( ¯ x , ¯ y , c ) ∧ U ( z ) defines R , so that for all ¯ a ∈ A and ¯ b ∈ B , ( ¯ a , ¯ b ) ∈ R ⇔ S | = ψ ( ¯ a , ¯ b ) .In particular, if | A | = n and | B | = n then for a suitably chosen U ⊆ C , the formula ψ definesa relation of VC-dimension n between A and B .Consider the expansion of C by a unary predicate U interpreted as finite sets. Then theformula ψ ( ¯ x , ¯ y ) above has unbounded VC-dimension on C , proving that C is not fmNIP. We now introduce a wholly model-theoretic notion characterizing bounded twin-width. Forthis, we first recall some basic notions from model theory.By a model we mean a structure which is typically infinite, as opposed to the structuresconsidered earlier, which were typically finite. We give a brief account of basic notions frommodel theory in Appendix A, although they are not needed to follow the main text below.The elementary closure of a class of structures C is the class of all models M that satisfy everysentence ϕ that holds in all structures S ∈ C . In particular, if C does not define large grids,then neither does its elementary closure. This is because for any fixed n ∈ N the existence ofan n × n -grid defined by a fixed formula ϕ ( ¯ x , ¯ y , z ) can be expressed by a first-order sentence ϕ (cid:48) which existentially quantifies ( | ¯ x | + | ¯ y | ) · n + n variables, corresponding to sets A , B , C of¯ x -tuples, ¯ y -tuples and single vertices, and then checks that ϕ defines a bijection between A × B and C .By the compactness theorem (cf. Thm. A.1), if C defines large grids, then its elementaryclosure contains a structure that defines a grid ( A , B , C ) with A and B of arbitrarily large infinitecardinalities. Definition 10 (Elementary extension).
Let M, N be two models. Then N is an elementary exten-sion of M, written M ≺ N, if the domain of M is contained in the domain of N, and for everyformula ϕ ( ¯ x ) and tuple ¯ a ∈ M ¯ x of elements of M,M | = ϕ ( ¯ a ) if and only if N | = ϕ ( ¯ a ) .29n other words, it doesn’t matter if we evaluate formulas in M or in N. In particular, M andN satisfy the same sentences.A formula ϕ ( ¯ x ) with parameters from C ⊆ N is a formula using constant symbols denotingelements from C . Such a formula can be evaluated in N on a tuple ¯ a ∈ N ¯ x , as expected. Note thatif M ≺ N and ϕ ( ¯ x ) is a formula with parameters from N and ¯ a ∈ M ¯ x then it is not necessarilythe case that M | = ϕ ( ¯ a ) if and only if N | = ϕ ( ¯ a ) , although this does hold for formulas withparameters from M. Definition 11 (Independence).
Let M be a model and N its elementary extension. For a tuple¯ a ∈ N ¯ x and a set B ⊆ N say that ¯ a is independent from B over M, denoted ¯ a || M B , if for everyformula ϕ ( ¯ x ) with parameters from B ∪ M such that N | = ϕ ( ¯ a ) there is some ¯ c ∈ M ¯ x such thatN | = ϕ ( ¯ c ) .Abusing notation, if B is enumerated by a tuple ¯ b , then we may write ¯ a || M ¯ b . We write (cid:45) | M for the negation of the relation || M . Example 8.1.
Let N be ( R , (cid:54) ) and let M be the union of the open intervals ]
0, 1 [ and ]
8, 9 [ ,equipped with the relation (cid:54) . Then M ≺ N. This is easy to derive from the fact that ( R , (cid:54) ) has quantifier elimination, that is, every formula ϕ ( ¯ x ) is equivalent to a quantifier-free formula.Figure 4 illustrates independence over M. F IGURE The structures M ≺ N , a set B and two tuples, ¯ a , ¯ e, with ¯ a || M B and ¯ e (cid:45) | M B. Example 8.2.
Let M ≺ N. Then ¯ a || M M for every ¯ a ∈ N ¯ x (cf. Lemma A.3). Definition 12 (1-dimensionality).
A model M is if for every M ≺ N, tuples ¯ a , ¯ b of elements of N and c ∈ N a single element, if ¯ a || M ¯ b then ¯ ac || M ¯ b or ¯ a || M ¯ bc . A class C ofstructures is if every model in the elementary closure of C is 1-dimensional. Example 8.3.
Any total order ( X , (cid:54) ) is 1-dimensional. As an illustration, in the situation in Fig. 4,consider the tuples ¯ a , ¯ b marked therein. Then ¯ a || M ¯ b . Let c ∈ N. If c belongs to the interval ] b , b [ then ¯ a || M ¯ bc . Otherwise, ¯ ac || M ¯ b . Example 8.4.
Let N = ( R × R , ∼ , ∼ ) where for i =
1, 2, the relation ∼ i denotes equality of the i th coordinates. Let M be the induced substructure of N with domain I × I for some infinitesubset I ⊆ N. Then M ≺ N. In the situation depicted in Fig. 5, a || M b but both ac (cid:45) | M b and a (cid:45) | M bc . So M is not 1-dimensional.The following result is essentially [She86, Lemma 2.2]. Proposition 8.6.
If a model M does not define large grids the it is 1-dimensional. More precisely, if thereis a formula ϕ ( ¯ x , ¯ y , z ) with parameters from M which is satisfied by ¯ a , ¯ b , c and such that ϕ ( ¯ x , ¯ b , z ) and ϕ ( ¯ x , ¯ b , c ) are not satisfiable in M then a boolean combination ψ of instances of ϕ defines large grids in M . IGURE The structures M ≺ N and elements a , b , c ∈ N with a || M b , ac (cid:45) | M b and a (cid:45) | M bc. See Appendix C for a proof. In particular, every class C that does not define large grids is1-dimensional. We now provide a characterization in terms of the number of types. The definition below gen-eralizes the definition of ( k , t ) -simplicity for ordered structures.Let ϕ ( x , ¯ y ) be a formula and S a structure. A ϕ -definable disjoint family is a family R ofpairwise disjoint of subsets of S, where for each R ∈ R there is ¯ b ∈ S ¯ y with R = ϕ ( S, ¯ b ) . Forexample, if S is an ordered structure and R is a convex partition of S, then R is a ϕ -definablefamily of pairwise disjoint sets, for ϕ ( x , y , y ) = y (cid:54) x (cid:54) y . Definition 13 (Regularity).
A class C of structures is regular if the following condition holds.Let ϕ ( x ; ¯ y ) , ψ ( x ; ¯ z ) and θ ( ¯ u ; ¯ v ) be L -formulas. Then there are natural numbers t and k such thatfor any S ∈ C and any ϕ -definable disjoint family R ⊆ P ( S ) and ψ -definable disjoint family L ⊆ P ( S ) with |R| = |L| (cid:62) t there are R ∈ R and L ∈ L with | Types θ ( R / L ) | (cid:54) k .Note that | Types θ ( R / L ) | (cid:54) k implies | Types ˆ θ ( L / R ) | (cid:54) k , where ˆ θ ( ¯ v ; ¯ u ) = θ ( ¯ u ; ¯ v ) . Soin the definition of regularity, we could equivalently require both | Types θ ( R / L ) | (cid:54) k and | Types ˆ θ ( L / R ) | (cid:54) k , as k can be increased appropriately.It is easy to see that if C is regular class of ordered graphs then C is ( k , t ) -simple for k , t obtained from the definition of regularity applied to the formulas ϕ = y (cid:54) x (cid:54) y and ψ = z (cid:54) x (cid:54) z and θ being the edge relation. This also holds for arbitrary classes of ordered binarystructures, as | Types Σ ( R / L ) | (cid:54) ∏ S ∈ Σ | Types S ( R / L ) | . We can finally state our main model-theoretic result. It extends Theorem 1.2 stated in the intro-duction.
Theorem 8.7.
Let C be any class of structures over a relational signature and consider the followingconditions:1. C does not transduce the class of all finite graphs,2. C is monadically NIP, rivial implication assumes hereditarity model-theoreticLem. 8.5Sec. 9[She86],cf. Prop. 8.6 Sec. 5, usesgrid Ramsey;assumes binary,ordered[She86],cf. Prop. 8.6Sec. 9 Sec. 6, usesMarcus-Tardos;assumes binary,finite, ordered[BKTW20a](cf. Fact 2) Cor. 7.2 [BGK + ]Prop. 4.1 Prop. 4.1 Prop. 4.1[Sim21], [BS85](cf. Cor. 8.3)doesn’t transduceall graphs (1)monadically NIP (2)finitely monadically NIP (3)no large grids (4)1-dimensional (5)regular (6) boundedtwin-width (7)doesn’t interpretall graphs (8) fpt model-checking smallNIP (9) no large quantifier-free grids (11)quantifier-free 1-dimensional (12)no large regular semigrids (10)quantifier-free regular (13) F IGURE Implications among the conditions in Theorems 8.7 and 8.8. All implications apply to arbitrary classesof structures, unless specified otherwise. . C is finitely monadically NIP,4. C does not define large grids,5. C is -dimensional,6. C is regular.Then the implications (1) ↔ (2) → (3) → (4) → (5) → (6) hold.Proof. The implications (1) ↔ (2) → (3) follow from Corollary 8.3 and Lemma 8.1. Implication(3) → (4) is by Lemma 8.5. The implication (4) → (5) is Proposition 8.6. The implication (5) → (6) isrelegated to Section 9 below.For a class C of ordered structures over a binary signature we may additionally prove theequivalence of all the above with C having bounded twin-width and furthermore improvesome of the conditions above to obtain quantifier-free formulas, as follows. See Fig. 6 for adiagram of all the various considered conditions and implications among them. Theorem 8.8.
Let C be a class of ordered structures over a binary signature Σ and C (cid:48) be the hereditaryclass of all its finite induced substructures. Then the following conditions are all equivalent to each otherand to the conditions (1) - (6) :7. C (cid:48) has bounded twin-width,8. C (cid:48) does not interpret the class of all finite graphs,9. C (cid:48) is NIP,10. C (cid:48) does not contain arbitrarily large regular semigrids,11. no quantifier-free formula defines large grids in C ,12. ( quantifier-free 1-dim .) let M ≺ N be models in the elementary closure of C , ¯ a ∈ N ¯ x , ¯ b ∈ N ¯ y tuples with ¯ a || M ¯ b, and c ∈ N ; then there is no quantifier-free formula ϕ ( ¯ x , ¯ y , z ) such that N | = ϕ ( ¯ a , ¯ b , c ) and such that both ϕ ( ¯ x , ¯ b , z ) and ϕ ( ¯ x , ¯ b , c ) are not satisfiable in M ,13. ( ( k , t ) - simple ) there are some k , t ∈ N such that for every structure S ∈ C and two convexpartitions L and R of S into t parts, there are L ∈ L and R ∈ R such that | Types Σ ( L / R ) | (cid:54) kand | Types Σ ( R / L ) | (cid:54) k.Proof. The implication (7) → (8) is by Fact 2, the implication (8) → (10) is by Corollary 5.8, (10) → (11) is by Theorem 5.1. The implication (11) → (12) is by the refined statement in Proposi-tion 8.6. The implication (12) → (13) is proved in Section 9 below, together with the implication(5) → (6). The implication (13) → (7) is by Theorem 3.1. This proves the equivalence of the condi-tions (7)-(13).Equivalence with the conditions (1)-(6) follows since (7) → (1) by Fact 2, (3) → (9) → (8) aretrivial, and (6) → (13) is immediate by the remark following Definition 13, as a convex partitionof S is a ϕ -definable disjoint family of subsets of S, for ϕ ( x , y , y ) = y (cid:54) x (cid:54) y .Theorem 8.8 yields Theorem 3.2, and thus completes the proof of our two main results,Theorem 1.1 and Theorem 1.2. It remains to prove implications (5) → (6) and (12) → (13).33 In this section we prove that every 1-dimensional class is regular, and prove the implication(12) → (13) in Theorem 8.8. We start with very briefly introducing some notions from modeltheory. A more comprehensive overview is presented in Appendix A. Let M ≺ N. For two sets A , B ⊆ N, write A || M B if ¯ a || M B for all tuples ¯ a of elements of A . Notethat A || M B if and only if ¯ a || M ¯ b for all tuples ¯ a in A and ¯ b in B . Lemma 9.1.
Fix a formula θ ( ¯ u ; ¯ v ) . Suppose A || M B. Then for all ¯ b ∈ B ¯ u , the type tp θ ( ¯ b / A ) dependsonly on the type tp θ ( ¯ b /M ) . More precisely, there is a function f : Types θ ( B /M ) → Types θ ( B /A ) such that tp θ ( ¯ b / A ) = f ( tp θ ( ¯ b /M )) . Proof.
We show that if tp θ ( ¯ b / A ) (cid:54) = tp θ ( ¯ b (cid:48) / A ) then tp θ ( ¯ b /M ) (cid:54) = tp θ ( ¯ b /M ) . If tp θ ( b / A ) (cid:54) = tp θ ( b (cid:48) / A ) then there is some ¯ a ∈ A ¯ v such that θ ( ¯ b , ¯ a ) (cid:52) θ ( ¯ b (cid:48) , ¯ a ) . By A || M B there is some ¯ m ∈ M ¯ v such that θ ( ¯ b , ¯ m ) (cid:52) θ ( ¯ b (cid:48) , ¯ m ) , implying tp θ ( ¯ b / A ) (cid:54) = tp θ ( ¯ b (cid:48) / A ) .As | Types ( B /M ) | (cid:54) | M | , we get a bound on the number of types. Corollary 9.2.
Fix a model M and its elementary extension N . Let A , B ⊆ N be such that A || M B. Forany formula θ ( ¯ u ; ¯ v ) the set Types θ ( B / A ) has cardinality at most | M | . The above bound can be leveraged to give a finite bound on the size of a set of types, asfollows.
Lemma 9.3.
Fix a model M and its elementary extension N. Let ϕ ( x ) and ψ ( x ) be two formulas withparameters from N . Suppose that for every elementary extension N (cid:48) of N , ϕ ( N (cid:48) ) || M ψ ( N (cid:48) ) . Then for every formula θ ( ¯ u ; ¯ v ) the set Types θ ( ψ ( N ) / ϕ ( N )) is finite.Proof. Fix a formula θ ( ¯ u ; ¯ v ) . Let E θ ( ¯ u ; ¯ u (cid:48) ) be the formula defining the equivalence relation on ψ ( N ) ¯ u such that E θ ( ¯ a , ¯ a (cid:48) ) ⇔ tp θ ( ¯ a / ϕ ( N )) = tp θ ( ¯ a (cid:48) / ϕ ( N )) for ¯ a , ¯ a (cid:48) ∈ ψ ( N ) ¯ u .More precisely, E θ ( ¯ u ; ¯ u (cid:48) ) ≡ ψ ( ¯ u ) ∧ ψ ( ¯ u (cid:48) ) ∧ ∀ ¯ v . ϕ ( ¯ v ) = ⇒ ( θ ( ¯ u ; ¯ v ) ⇐⇒ θ ( ¯ u (cid:48) ; ¯ v )) .Suppose E θ defines infinitely many classes in N. By compactness there is an elementaryextension N (cid:48) of N such that E θ induces more than 2 | M | equivalence classes in N (cid:48) (cf. Lemma A.2).By assumption, ϕ ( N (cid:48) ) || M ψ ( N (cid:48) ) .By Corollary 9.2, Types θ ( ψ ( N (cid:48) ) / ϕ ( N (cid:48) )) has cardinality at most 2 | M | , which is in contradictionwith the number of classes of E θ in N (cid:48) . 34 emark 9.1. To arrive at the conclusion of Lemma 9.3, the assumption ϕ ( N (cid:48) ) || M ψ ( N (cid:48) ) can beweakened as follows: for all ¯ b , ¯ b (cid:48) ∈ M ¯ u and σ ( ¯ v ) = θ ( ¯ b ; ¯ v ) (cid:52) θ ( ¯ b (cid:48) ; ¯ v ) , if σ ( ¯ v ) is satisfiable in ϕ ( N (cid:48) ) then it is satisfiable in M. The same proof as above works, since σ is the only formula thatappears in the proof of Lemma 9.1. (5) → (6) and (12) → (13) Let C be a class which is not regular. We show that C is not 1-dimensional. We first construct astructure M in the elementary closure of C that exhibits the lack of regularity in a handy way.Say that a class C is not regular as witnessed by formulas ϕ ( x , ¯ y ) , ψ ( x , ¯ z ) , θ ( ¯ u , ¯ v ) if for all k , t ∈ N there are:– a structure S ∈ C ,– a ϕ -definable disjoint family R ⊆ P ( S ) with |R| (cid:62) t ,– a ψ -definable disjoint family L ⊆ P ( S ) with |L| (cid:62) t ,such that | Types θ ( R / L ) | > k for all R ∈ R and L ∈ L .If C is not regular then there are some ϕ , ψ , θ that witness it. Remark 9.2.
Suppose C is a class of ordered binary structures which is not ( k , t ) -simple for all k , t ∈ N . That is, for all k , t ∈ N there is a structure S ∈ C and two convex partitions L and R of S into t parts, there are no L ∈ L and R ∈ R such that | Types Σ ( L / R ) | (cid:54) k and | Types Σ ( R / L ) | (cid:54) k . Then C is not regular as witnessed by ϕ ( x , y , y ) ≡ y (cid:54) x (cid:54) y and ψ ( x , z , z ) ≡ z (cid:54) x (cid:54) z and θ ( u , v ) a quantifier-free Σ -formula with two variables. Lemma 9.4.
Suppose C is not regular, as witnessed by formulas ϕ ( x , ¯ y ) , ψ ( x , ¯ z ) , θ ( ¯ u , ¯ v ) . Then thereexist:– a structure M in the elementary closure of C ,– an elementary extension N of M ,– tuples ¯ a , ¯ a ∈ N ¯ y and ¯ b ∈ N ¯ z ,such that the following properties hold:1. tp ( ¯ a /M ) = tp ( ¯ a /M ) ,2. the set Types θ ( B / A ) is infinite, where A = ϕ ( N, ¯ a ) and B = ψ ( N, ¯ b ) ,3. ¯ a || M ¯ a ¯ b ,4. ϕ ( x ; ¯ a ) ∧ ϕ ( x , ¯ a ) has no solution in N ,5. ψ ( x ; ¯ b ) has no solution in M . The proof of the lemma is a standard application of basic tools from model theory: com-pactness, (mutually) indiscernible sequences and Morley sequences, which are recalled in Ap-pendix A. The proof of Lemma 9.4 is in Appendix B. Using the lemma, we now show that C isnot 1-dimensional. 35e use the notation from Lemma 9.4. Let M and N be as in Lemma 9.4. By (2) and Lemma 9.3there is an elementary extension N (cid:48) of N and tuples ¯ a ∈ ϕ ( N (cid:48) , ¯ a ) , ¯ b ∈ ψ ( N (cid:48) , ¯ b ) such that ¯ a (cid:45) | M ¯ b .We show that if M is 1-dimensional then ¯ a ¯ a || M ¯ a ¯ b ¯ b , implying ¯ a || M ¯ b , contrary to what wasjust stated. Claim 9.1.
Let a ∈ ϕ ( N (cid:48) , ¯ a ) . Then ¯ a (cid:45) | M ¯ a a.Proof : Consider the formula ζ ( ¯ y ; a , ¯ a ) : = ϕ ( a ; ¯ y ) ∧ ¬∃ x . ϕ ( x ; ¯ y ) ∧ ϕ ( x ; ¯ a ) . (1)Then ζ ( ¯ a ; a , ¯ a ) holds since ϕ ( x ; ¯ a ) and ϕ ( x ; ¯ a ) are inconsistent by (4). Assume that there issome ¯ a (cid:48) ∈ M ¯ y such that ζ ( ¯ a (cid:48) ; a , ¯ a ) holds. Then ∃ x . ϕ ( x ; ¯ a (cid:48) ) ∧ ϕ ( x ; ¯ a ) holds in N (cid:48) , as witnessed by x = a . By property (1) and as ¯ a (cid:48) is in M, this implies that ∃ x . ϕ ( x ; ¯ a (cid:48) ) ∧ ϕ ( x ; ¯ a ) holds in N (cid:48) , contradicting ζ ( ¯ a (cid:48) ; a , ¯ a ) . Thus ζ ( ¯ y ; a , ¯ a ) has no solution in M. In particular, ¯ a (cid:45) | M ¯ a a , proving the claim. Claim 9.2.
Suppose M is -dimensional and let ¯ a be a tuple in ϕ ( N (cid:48) ; ¯ a ) and ¯ b a tuple in ψ ( N (cid:48) ; ¯ b ) .Then ¯ a ¯ a || M ¯ a ¯ b ¯ b . Proof : We show the result by induction on the length of ¯ a and ¯ b . The base case where ¯ a and¯ b are empty is given by property (3).Assume we know the result for ¯ a , ¯ b and we want to add an element b ∈ ψ ( N (cid:48) ; ¯ b ) to ¯ b . By1-dimensionality, one of the two cases holds:¯ a ¯ a b || M ¯ a ¯ b ¯ b or ¯ a ¯ a || M ¯ a ¯ b ¯ b b .Note that property (5) implies b (cid:45) | M ¯ b , excluding the first case, so the second case must hold, asrequired.Now assume we want to add a ∈ ϕ ( N (cid:48) ; ¯ a ) to ¯ a . By 1-dimensionality,¯ a ¯ a a || M ¯ a ¯ b ¯ b or ¯ a ¯ a || M ¯ a ¯ b ¯ ba ,but the second possibility is excluded by Claim 9.1, and the first one concludes the inductivestep. This proves Claim 9.2.Since there are ¯ a ∈ ϕ ( N (cid:48) ; ¯ a ) and ¯ b ∈ ψ ( N (cid:48) ; ¯ b ) with ¯ a (cid:45) | M ¯ b by (2) and Corollary 9.2, Claim 9.2implies M is not 1-dimensional.This finishes the proof of the implication (5) → (6) in Theorem 8.7, and completes the proofof the theorem. We now finish the proof of Theorem 8.8. Proof of Theorem 8.8.
It remains to prove the implication (12) → (13) in Theorem 8.8.36e just proved that if C is not regular, then there are M ≺ N (cid:48) in the elementary closure of C and tuples ¯ a , ¯ b ∈ N (cid:48) and a single element c ∈ N (cid:48) such that:¯ a || M ¯ b , ¯ ac (cid:45) | M ¯ b , ¯ a (cid:45) | M ¯ bc ,so M is not 1-dimensional. The formulas that exhibit ¯ ac (cid:45) | M ¯ b and ¯ a (cid:45) | M ¯ bc depend only on θ , ψ , ϕ (and not on C ), and are among the following:1. the formula θ ( ¯ u ; ¯ b ) (cid:52) θ ( ¯ u ; ¯ b (cid:48) ) , cf. Remark 9.1,2. the formula ψ ( x ; ¯ b ) , cf. property (5) in Lemma 9.4,3. the formula ζ ( ¯ y ; a , ¯ e ) ≡ ϕ ( a ; ¯ y ) ∧ ¬∃ x . ϕ ( x ; ¯ y ) ∧ ϕ ( x ; ¯ e ) , cf. (1).In particular, if ϕ ( a ; ¯ y ) is the formula y (cid:54) a (cid:54) y , where (cid:54) defines a total order in C , then ζ isequivalent to a quantifier-free formula, namely ( y (cid:54) a (cid:54) y ) ∧ (( ¯ y > e ) ∨ ( ¯ y < e )) . Hence,in the setting of Remark 9.2, all the above formulas are quantifier-free Σ -formulas. This provesthe implication (12) → (13) in Theorem 8.8, and completes its proof. A Model theoretic preliminaries
A.1 Basic notions from model theory
Models and theories.
In model theory, structures are called models , and we will therefore de-note them M, N, etc. They will typically be infinite.A (first-order) theory is a set T of sentences over a fixed signature. A model of a theory T is amodel M (finite or not) which satisfies all the sentences in T , which is denoted M | = T . We saythat T has a model if there is some model M of T . The theory of a class of structures C is the set T of all sentences ϕ such that S | = ϕ for allS ∈ C . Trivially, every structure in C is a model of T , but typically, T has also other models.Those can be constructed using the compactness theorem: Theorem A.1 (Compactness of first-order logic) . Let T be a theory such that every finite subsetT (cid:48) ⊆ T has a model. Then T has a model.
For example, let C be a class of structures over a signature Σ , and assume that C containsstructures of arbitrarily large finite size. Then the models of the theory of C also include infinitemodels of arbitrarily large cardinality. To see this, consider the theory T of C and let Σ (cid:48) extendthe signature of C by an arbitrary set C of constant symbols. For c , d ∈ C , let ϕ cd be the Σ (cid:48) -sentence c (cid:54) = d . Then T ∪ { ϕ cd | c , d ∈ C , c (cid:54) = d } satisfies the assumption of the compactnesstheorem, so it has a model M, and this model has at least the cardinality of C . Elementary extensions.
Let M, N be two models such that the domain of M is contained inthe domain of N. Then N is an elementary extension of M, written M ≺ N, if for every formula ϕ ( ¯ x ) and tuple ¯ a ∈ M ¯ x of elements of M,M | = ϕ ( ¯ a ) if and only if N | = ϕ ( ¯ a ) .In other words, it doesn’t matter if we evaluate formulas in M or in N.37 typical way of constructing an elementary extension of M is by considering the followingtheory, called the elementary diagram of M. Let Σ be the signature of M, and let Σ (cid:48) = Σ ∪ M,where the elements of M are viewed as constant symbols.For a Σ -formula ϕ ( ¯ y ) and tuple ¯ a ∈ M ¯ y write ϕ ( ¯ a ) for the Σ (cid:48) -sentence obtained by replacingthe variables in ¯ y by constants in M, according to ¯ a . Let T be the Σ (cid:48) -theory consisting of allsentences ϕ ( ¯ a ) , for all Σ -formulas ϕ ( ¯ x ) and tuples ¯ a such that M | = ϕ ( ¯ a ) .Pick a model N (cid:48) of T , and let N denote the Σ -structure obtained from N (cid:48) by forgetting theconstants in M ⊆ Σ (cid:48) . The interpretation of the constants m ∈ M of Σ (cid:48) in N (cid:48) yields a function i : M → N. By the definition of T , for any formula ϕ ( ¯ y ) and tuple ¯ a ∈ M ¯ y ,M | = ϕ ( ¯ a ) if and only if N | = ϕ ( i ( ¯ a )) .Therefore, we may view (identyfing each m ∈ M with i ( m ) ∈ N) the Σ -structure N as anelementary extension of M.Reassuming, models of the elementary diagram of M correspond precisely to elementaryextensions of M. In particular, by extending the elementary diagram of M by an arbitrary setof constants, from compactness we get that M has elementary extensions of arbitrarily largecardinality (unless M is finite). More generally, we have the following. Lemma A.2.
Let M be a model and let α ( ¯ x , ¯ x (cid:48) ) be a formula with | ¯ x | = | ¯ x (cid:48) | defining an equivalencerelation in M with infinitely many classes. Then for every cardinality n there is an elementary extension N (cid:31) M in which α defines an equivalence relation with at least n equivalence classes.Proof. To simplify notation, assume that | ¯ x | = | ¯ x (cid:48) | =
1. The case of | ¯ x | = | ¯ x (cid:48) | = k > k = k and the k projection functions.Let α ( x , x (cid:48) ) be formula defining an equivalence relation ∼ in M with infinitely many classes.Let Σ be the signature of M. Fix any set of constants C and let Σ (cid:48) extend Σ by C ∪ M, where all theadded elements are constant symbols. For any c , d ∈ C consider the Σ (cid:48) -sentence ϕ cd = ¬ α ( c , d ) .Let T be the Σ (cid:48) -theory consisting of:– the sentences ϕ cd , for all c (cid:54) = d in C ,– the elementary diagram of M.We show that every T (cid:48) ⊆ T containing finitely many sentences of the form ϕ cd has a model.Let C (cid:48) ⊆ C be the finite set of constants appearing in the sentences ϕ cd ∈ T (cid:48) . Let M (cid:48) be themodel M together with each constant c in M ⊆ Σ (cid:48) interpreted as the corresponding element c ∈ M, and constants in C (cid:48) interpreted as pairwise ∼ -inequivalent elements of M, and constantsin C − C (cid:48) interpreted as arbitrary elements of M. This can be done, since there are infinitelymany pairwise ∼ -inequivalent elements in M. This shows that T (cid:48) has a model.By compactness, T has a model N (cid:48) . This model can be seen as an elementary extensionof T together with a set of | C | elements which are pairwise inequivalent with respect to theequivalence relation defined by α in N. Since C was taken arbitrary, this proves the lemma. Parameters.
Let M be a model over a signature Σ and let A ⊆ M be a set of elements. Wemay view M as a model over a signature Σ ∪ A , where the elements of A are seen as constantsymbols, interpreted in M in the expected way: a constant a ∈ A is interpreted as the element a ∈ M. We call the elements of
A parameters in this context. A Σ -formula with parameters from A is a formula over the signature Σ ∪ A . 38 ypes. A type with variables ¯ x and parameters from A , or a type over A is a set p of formulas ϕ ( ¯ x ) with parameters from A . We may write p ( ¯ x ) to indicate that p has variables ¯ x .If p ( ¯ x ) is a type over A and B ⊆ A then p | B denotes the subset of p consisting of all formulaswith parameters from B . If ¯ b ∈ M ¯ x is a tuple of elements of M then the type of ¯ b over A in M is theset of formulas ϕ ( ¯ x ) with parameters from A that are satisfied by ¯ b in M. This type is denotedtp ( ¯ b / A ) or tp ¯ x ( ¯ b / A ) . Note that tp ( ¯ b / A ) is related to the notion of θ -types as follows, for everyformula θ ( ¯ x ; ¯ y ) and tuple ¯ a ∈ A ¯ y : θ ( ¯ x ; ¯ a ) ∈ tp ( ¯ b / A ) ⇐⇒ ¯ a ∈ tp θ ( ¯ b / A ) .In particular, tp ( ¯ b / A ) is uniquely determined by { tp θ ( ¯ b / A ) | θ ( ¯ x ; ¯ y ) is a formula } .A type p ( ¯ x ) is satisfiable in a set C if there is some tuple ¯ c ∈ C ¯ x which satisfies all the formulasin p . A type p ( ¯ x ) with parameters from A ⊆ M is satisfiable if it is satisfiable in some elementaryextension N of M. By compactness, this is equivalent to saying that for any finite conjunction ϕ ( ¯ x ) of formulas in p ( ¯ x ) we have M | = ∃ ¯ x . ϕ ( ¯ x ) .A type p ( ¯ x ) with parameters from A is complete if it is satisfiable and for every formula ϕ ( ¯ x ) with parameters from A , either ϕ or ¬ ϕ belongs to p . Equivalently, p ( ¯ x ) is the type over A of some tuple ¯ b ∈ N ¯ x , for some elementary extension N of M. We sometimes say that a typeis partial to emphasise that it may not be complete. We denote the set of complete types withvariables ¯ x and parameters from A by S ¯ x ( A ) or simply S ( A ) , if ¯ x is understood from the context.Note that we have ommitted the model M from the notation. Indeed, if M (cid:48) is a model containingthe parameters A and satisfying the same sentences with parameters from A as M, then M andM (cid:48) have identical sets of complete types p ( ¯ x ) with parameters from A . Hence, S ¯ x ( A ) does notdepend on M, but only on the set of sentences satisfied by A in M. A.2 Finite satisfiability
A (partial) type p ( ¯ x ) with parameters from A is finitely satisfiable in C if every finite subset p (cid:48) ⊆ p is satisfiable in C . Note that ¯ a || M B (cf. Def. 11) if and only if tp ( ¯ a /M B ) is finitely satisfiablein M. Lemma A.3.
A type p ( ¯ x ) with parameters from M is finitely satisfiable in M if and only if it is satisfiable.Consequently, ¯ a || M M for all ¯ a in an elementary extension of M .Proof. For the right-to-left implication, assume that p is satisfied by some tuple ¯ c ∈ N ¯ x for someelementary extension N of M. Pick a finite p (cid:48) ⊆ p , and suppose p (cid:48) = { ϕ , . . . , ϕ k } . Consider theformula ψ : = ϕ ∧ · · · ∧ ϕ k . Note that ψ may use some parameters from M. So we may write ψ as ψ = ψ (cid:48) ( ¯ x , ¯ a ) where ψ (cid:48) ( ¯ x , ¯ z ) is a formula and ¯ a ∈ M z .The formula ∃ ¯ x ψ (cid:48) ( ¯ x , ¯ a ) holds in N, as witnessed by ¯ c . As N is an elementary extension ofM, this formula also holds in M. So there is some ¯ m ∈ M satisfying ψ (cid:48) ( ¯ b , ¯ a ) . Therefore, p (cid:48) issatisfied by ¯ m in M, proving that p is finitely satisfiable in M.The left-to-right implicaiton is a basic application of the compactness theorem.Consider the signature Σ (cid:48) = Σ ∪ M ∪ ¯ x extending Σ by constant symbols for each element ofM and each variable in ¯ x . Let T be the theory over Σ (cid:48) consisting of:– For every formula ϕ ( ¯ x ) ∈ p , the Σ (cid:48) -sentence obtained from ϕ ( ¯ x ) by viewing each param-eter a ∈ M as the constant a ∈ M ⊆ Σ (cid:48) , and each variable x ∈ ¯ x as the constant x ∈ ¯ x ⊆ Σ (cid:48) .– the elementary diagram of M. 39hen every finite subset T (cid:48) of T has a model. Indeed, let p (cid:48) be the set of formulas ϕ ( ¯ x ) which occur (as Σ (cid:48) -sentences) in T (cid:48) . Since p ( ¯ x ) is finitely satisfiable in M, p (cid:48) ( ¯ x ) is satisfied bysome tuple ¯ m ∈ M ¯ x . The pair ( M, ¯ m ) may be seen as a Σ (cid:48) -structure, where a constant m ∈ Mis interpreted by the corresponding element of M, and a constant x ∈ ¯ x is interpreted as ¯ m ( x ) .Then ( M, ¯ m ) is a model of T (cid:48) .By compactness, T has a model N (cid:48) . This model can be seen as an elementary extension N ofM together with a tuple ¯ c ∈ N ¯ x of elements (obtained by the interpretation of the constants ¯ x inN (cid:48) ), such that N | = ϕ ( ¯ c ) for every formula ϕ ( ¯ x ) ∈ p . Hence, ¯ c satisfies p ( ¯ x ) in N. Finite satisfiability and filters.
Recall that a filter on a set U is a nonempty set F ⊆ P ( U ) that isclosed under taking supersets (if A ⊆ B then A ∈ F implies B ∈ F ), under binary intersections,and does not contain the empty set. A filter is an ultrafilter if for every A ⊆ U , either A ∈ F or U − A ∈ F . Every filter is contained in some ultrafilter, by the Kuratowski-Zorn lemma.Let N be a model, A ⊆ N be a set and ¯ x be a set of variables. Fix a filter F on A ¯ x . The average(partial) type over N is the partial type denoted Av F ( ¯ x ) such that for every formula ϕ ( ¯ x ) withparameters from N, ϕ ( ¯ x ) ∈ Av F ( ¯ x ) ⇐⇒ { ¯ a ∈ A ¯ x : N | = ϕ ( ¯ a ) } ∈ F .This is a consistent partial type: if say ϕ ( ¯ x ) , . . . , ϕ n ( ¯ x ) ∈ π ( ¯ x ) , then since any finitely manyelements of F have non-empty intersection, there is ¯ a ∈ A ¯ x which satisfies the conjunction ϕ ( ¯ x ) ∧ · · · ∧ ϕ n ( ¯ x ) . Hence this conjunction is consistent, indeed we have shown that Av F ( ¯ x ) isfinitely satisfiable in A .If F is an ultrafilter on A ¯ x , then Av F ( ¯ x ) is a complete type: for every formula ϕ ( ¯ x ) , either ϕ ( ¯ x ) ∈ Av F ( ¯ x ) or ¬ ϕ ( ¯ x ) ∈ Av F ( ¯ x ) . Lemma A.4.
Let π ( ¯ x ) be a partial type, then π ( ¯ x ) is finitely satisfiable in A if and only if there is afilter F on A ¯ x such that π ( ¯ x ) ⊆ Av F ( ¯ x ) .Proof. We have already observed that Av F ( ¯ x ) is finitely satisfiable in A . Conversely, assumethat π ( ¯ x ) is finitely satisfiable in A , then define F ⊆ P ( A ¯ x ) by: F = { ϕ ( A ) : ϕ ( ¯ x ) ∈ π ( ¯ x ) } .The fact that π ( ¯ x ) is finitely satisfiable in A implies that any finitely many elements of F havenon-empty intersection. Let F be the filter generated by F . Then we have π ( ¯ x ) ⊆ Av F ( ¯ x ) . Lemma A.5.
Let p ( ¯ x ) ∈ S ( N ) be a complete type, then p ( ¯ x ) is finitely satisfiable in A if and only ifthere is an ultrafilter F on A ¯ x such that p ( ¯ x ) = Av F ( ¯ x ) .Proof. We have already seen that if F is an ultrafilter on A ¯ x , then Av F ( ¯ x ) is a complete type overN, which is finitely satisfiable in A . Conversely, if p ( ¯ x ) ∈ S ( N ) is finitely satisfiable in A , thenby the previous lemma, there is a filter F on A ¯ x such that p ( ¯ x ) ⊆ Av F ( ¯ x ) . Extend F to anultrafilter F on A ¯ x . Then p ( ¯ x ) ⊆ Av F ( ¯ x ) ⊆ Av F ( ¯ x ) . But since p ( ¯ x ) is a complete type, onecannot add any formulas to it without making it inconsistent. Since Av F ( ¯ x ) is consistent, wemust have p ( ¯ x ) = Av F ( ¯ x ) . Lemma A.6.
Let π ( ¯ x ) be a partial type finitely satisfiable in A. Then there is a complete type p ( ¯ x ) ∈ S ( N ) finitely satisfiable in A which extends π ( ¯ x ) .Proof. Let F be a filter on A ¯ x such that π ( ¯ x ) ⊆ Av F ( ¯ x ) . Let F (cid:48) be an ultrafilter extending F andlet p ( ¯ x ) = Av F (cid:48) ( ¯ x ) . Then p is finitely satisfiable in A and extends π .40 emma A.7. Let p ( ¯ x ) ∈ S ( N ) be finitely satisfiable in A. Then p is A -invariant , that is: for anyformula ϕ ( ¯ x ; ¯ y ) and tuples ¯ b , ¯ b (cid:48) ∈ N ¯ y , we have: tp ( ¯ b / A ) = tp ( ¯ b (cid:48) / A ) = ⇒ ϕ ( ¯ x ; ¯ b ) ∈ p ↔ ϕ ( ¯ x ; ¯ b (cid:48) ) ∈ p . Proof.
If tp ( ¯ b / A ) = tp ( ¯ b (cid:48) / A ) , then the formula ϕ ( ¯ x ; ¯ b ) (cid:52) ϕ ( ¯ x ; ¯ b (cid:48) ) has no solution in A . Since p isfinitely satisfiable in A that formula cannot be in p . Hence as p is a complete type, the formula ϕ ( ¯ x ; ¯ b ) ↔ ϕ ( ¯ x ; ¯ b (cid:48) ) is in p as required. A.3 Indiscernible sequences
Definition 14.
Let M be a structure and A ⊆ M. Let I be a linear order. A sequence ( ¯ a i : i ∈ I ) of tuples of M is indiscernible over A if for any n < ω and indices i < · · · < i n i (cid:48) < · · · < i (cid:48) n in I , we have tp ( a i , . . . , a i n / A ) = tp ( a i (cid:48) , . . . , a i (cid:48) n / A ) .Another way to state this is that the sequence ( ¯ a i : i ∈ I ) is indiscernible over A if for any n < ω , indices i < · · · < i n i (cid:48) < · · · < i (cid:48) n in I and formula θ ( ¯ x , . . . , ¯ x n ) with parameters in A , we have ( ) M | = θ ( ¯ a i , . . . , ¯ a i n ) ↔ θ ( ¯ a i (cid:48) , . . . , ¯ a i (cid:48) n ) .If ∆ is a set of formulas with parameters in A , we will say that the sequence ( ¯ a i : i ∈ I ) is ∆ -indiscernible if ( ) holds for each θ in ∆ . If ∆ and I are both finite, then this is expressible by asingle first order formula. Definition 15.
Two sequences ( ¯ a i : i ∈ I ) and ( ¯ b j : j ∈ J ) are mutually indiscernible over A if ( ¯ a i : i ∈ I ) is indiscernible over A ∪ { ¯ b j : j ∈ J } and ( ¯ b j : j ∈ J ) is indiscernible over A ∪ { ¯ a i : i ∈ I } .An equivalent definition is that the sequences ( ¯ a i : i ∈ I ) and ( ¯ b j : j ∈ J ) are mutuallyindiscernible over A if for any n < ω , indices i < · · · < i n i (cid:48) < · · · < i (cid:48) n and j < · · · < j n j (cid:48) < · · · < j (cid:48) n in I and any formula θ ( ¯ x , . . . , ¯ x n ; ¯ y , . . . , ¯ y n ) with parameters in A , we have ( ) M | = θ ( ¯ a i , . . . , ¯ a i n ; ¯ b j , . . . , ¯ b j n ) ↔ θ ( ¯ a i (cid:48) , . . . , ¯ a i (cid:48) n ; ¯ b j (cid:48) , . . . , ¯ b j (cid:48) n ) .If ∆ is a set of formulas with parameters in A , we will say that the sequences ( ¯ a i : i ∈ I ) and ( ¯ b j : j < ω ) are mutually ∆ -indiscernible if ( ) holds for each θ in ∆ . If ∆ , I and J are finite, thenthis is again expressible by a single first-order formula.41n the following lemma, we use the notation Av F | C to mean the restriction of the type Av F to C . We also use the notation ¯ a < i to mean { ¯ a j : j < i } . Lemma A.8.
Let A ⊆ B ⊆ M . Let F be an ultrafilter on A ¯ x . Let I be a linear order and let ( ¯ a i : i ∈ I ) be a sequence of tuples of M such that: ¯ a i | = Av F | B ¯ a < i . Then the sequence ( ¯ a i : i ∈ I ) is indiscernible over B.Proof. Write p = Av F . Note that p is finitely satisfiable in A and a fortiori finitely satisfiable in B . We prove by induction on n that if n < ω and i < · · · < i n , j < · · · < j n are in I , thentp ( ¯ a i , . . . , ¯ a i n / A ) = tp ( ¯ a j , . . . , ¯ a j n / A ) . For n = a i realizeAv F | B , which is a complete type over B . Assume we know it for n and take i < · · · < i n < i n + , j < · · · < j n < j n + in I . By induction hypothesis, we havetp ( ¯ a i , . . . , ¯ a i n / B ) = tp ( ¯ a j , . . . , ¯ a j n / B ) .By Lemma A.7, for any formula θ ( ¯ x ; ¯ y , . . . , ¯ y n ) with parameters in B , we have: θ ( ¯ x ; ¯ a i , . . . , ¯ a i n ) ∈ p ⇐⇒ θ ( ¯ x ; ¯ a j , . . . , ¯ a j n ) ∈ p .Now since ¯ a i n + | = p | Ba i . . . a i n , we have θ ( ¯ x ; ¯ a i , . . . , ¯ a i n ) ∈ p ⇐⇒ N | = θ ( ¯ a i n + ; ¯ a i , . . . , ¯ a i n ) ,and similarly since ¯ a j n + | = p | Ba j . . . a j n , we have θ ( ¯ x ; ¯ a j , . . . , ¯ a j n ) ∈ p ⇐⇒ N | = θ ( ¯ a j n + ; ¯ a j , . . . , ¯ a j n ) .Putting all of this together, we getN | = θ ( ¯ a i n + ; ¯ a i , . . . , ¯ a i n ) ⇐⇒ N | = θ ( ¯ a j n + ; ¯ a j , . . . , ¯ a j n ) .Since the formula θ was an arbitrary formula with parameters in B , we deducetp ( ¯ a i , . . . , ¯ a i n + / B ) = tp ( ¯ a j , . . . , ¯ a j n + / B ) as required. Definition 16.
Let the type p ( ¯ x ) ∈ S ( M ) be finitely satisfiable in A ⊆ M and let A ⊇ B ⊆ M. Asequence ( ¯ a i : i ∈ I ) of tuples in M ¯ x such that ¯ a i | = p | B ¯ a < i is called a Morley sequence of p over B . By the previous lemma, a Morley sequence of p over B is indiscernible over B . A.4 Building indiscernible sequences
Indiscernible sequences are easy to find thanks to Ramsey’s theorem.
Definition 17.
Let ( ¯ a i : i < ω ) be a sequence of tuples in some structure M. A family ( ¯ b i : i ∈ I ) indexed by a linear order I is based on ( ¯ a i ) i < ω if for any formula θ ( x , . . . , x n ) ∈ L and i < . . . < n in I , if M | = θ ( b i , . . . , ¯ b i n ) then there are j < . . . < j n < ω such that M | = θ ( ¯ a j , . . . , ¯ a j n ) .Note that if ( ¯ a i : i < ω ) is indiscernible and ( ¯ b i : i ∈ I ) is based on it, then it is alsoindiscernible: indeed for any i < . . . < i n in I and any j < . . . < j n < ω , we havetp ( ¯ b i , . . . , ¯ b i n ) = tp ( ¯ a j , . . . , ¯ a j n ) . Proposition A.9.
Let ( ¯ a i : i < ω ) be a sequence of tuples in some structure M and let I be any linearlyordered set. There is an elementary extension M ≺ N and a sequence ( ¯ b i : i ∈ I ) of tuples of N that isbased on ( ¯ a i ) i < ω .Proof. Follows from Ramsey and compactness.We have analogues for two sequences.
Definition 18.
Let ( ¯ a i : i < ω ) and ( ¯ a (cid:48) i : i < ω ) be two sequences of tuples in M. Two families ( ¯ b i : i ∈ I ) , ( ¯ b (cid:48) j : j ∈ J ) indexed by linear orders I and J are based on ( ¯ a i ) i < ω and ( ¯ a (cid:48) i ) i < ω iffor any formula θ ( ¯ x , . . . , ¯ x n ; ¯ y , . . . , ¯ y m ) ∈ L and i < . . . < i n in I and j < . . . < j m in J , ifM | = θ ( ¯ b i , . . . , ¯ b i n ; ¯ b (cid:48) j , . . . , ¯ b (cid:48) j n ) then there are k < . . . < k n < ω and k (cid:48) < . . . < k (cid:48) m < ω suchthat M | = θ ( ¯ a k , . . . , ¯ a k n ; ¯ a k (cid:48) , . . . , ¯ a k (cid:48) m ) .Here is a finitary version of Proposition A.9 for two sequences. Lemma A.10.
Let ∆ be a finite set of formulas and let m , d < ω . Then there is some m ∗ < ω suchthat if ( ¯ a i : i < m ∗ ) and ( ¯ b i : i < m ∗ ) are two sequences of d-tuples of a structure M , then there are ( ¯ a (cid:48) i : i < m ) and ( ¯ b (cid:48) i : i < m ) subsequences of ( ¯ a i ) i < m ∗ and ( ¯ b i ) i < m ∗ respectively such that the sequences ( ¯ a (cid:48) i : i < m ) and ( ¯ b (cid:48) i : i < m ) are mutually ∆ -indiscernible. Proposition A.11.
Let ( ¯ a i : i < ω ) and ( ¯ a (cid:48) i : i < ω ) be two sequences of tuples in M and let I , Jbe two linearly ordered sets. There is an elementary extension M ≺ N and sequences ( ¯ b i : i ∈ I ) and ( ¯ b (cid:48) j : j ∈ J ) of tuples of N which are based on ( ¯ a i ) i < ω and ( ¯ a (cid:48) i ) i < ω .Proof. Follows from Lemma A.10 and compactness.
Lemma A.12.
Let N be a model and I = ( ¯ a i : i < ω ) an indiscernible sequence of tuples of N . Thereis an elementary extension N ≺ N (cid:48) , a submodel M ≺ N (cid:48) and an ultrafilter F on M ¯ x such that I is aMorley sequence of Av F over M .Proof. In an elementary extension of N, we can increase the sequence to I + J , where J = ( ¯ b i : i ∈ Z ) so that the sequence I + J is indiscernible. Let F be an ultrafilter on { ¯ b i | i ∈ Z } thatcontains all subsets of the form { ¯ b i | i < n } for n ∈ Z . It follows from indiscernibility thatthe sequence I is a Morley sequence of Av F over { ¯ b i | i ∈ Z } . Possibly up to passing to afurther elementary extension, we can find an elementary submodel M such that I is a Morleysequence of Av F over M. One can see that by compactness, or alternatively, take M any modelcontaining { ¯ a (cid:48) i | i ∈ Z } , let I (cid:48) = ( ¯ a (cid:48) i : i < ω ) be a Morley sequence of Av F over M . Now I hasthe same type as I (cid:48) over J , so passing to an elementary extension, there is an automorphism σ fixing { ¯ b i | i ∈ Z } pointwise and sending I (cid:48) to I . Then take M = σ ( M ) .Finally, define F to be the unique ultrafilter on M extending F (so a set A is in F if and onlyif it contains a set in F ). Then I is a Morley sequence of Av F over M . Lemma A.13.
Let N be a structure and let I = ( ¯ a i : i < ω ) and J = ( ¯ b j : j < ω ) two mutuallyindiscernible sequences of tuples of N . There is an elementary extension N ≺ N (cid:48) , a submodel M ≺ N (cid:48) wo ultrafilters F and F (cid:48) on M ¯ x such that I is a Morley sequence of Av F over M ∪ { ¯ a i : i < ω } and J isa Morley sequence of Av F (cid:48) over M ∪ { ¯ b j : j < ω } .Proof. The proof is very similar to the previous one. First, in an elementary extension, constructsequences I (cid:48) = ( ¯ a (cid:48) i : i ∈ Z ) and J (cid:48) = ( ¯ b (cid:48) j : j ∈ Z ) so that the two sequences I + I (cid:48) and J + J (cid:48) aremutually indiscernible. This is possible by compactness. Let F be an ultrafilter on { ¯ a (cid:48) i | i ∈ Z } containing all initial segments as in the previous proof and similarly for F (cid:48) on { ¯ b (cid:48) j | j ∈ Z } .Then I is a Morley sequence of Av F over { ¯ a (cid:48) i | i ∈ Z } ∪ { ¯ b j | j < ω } ∪ { ¯ b (cid:48) j | j ∈ Z } and J is aMorley sequence of Av F (cid:48) over { ¯ a i | i < ω } ∪ { ¯ a (cid:48) i | i ∈ Z } ∪ { ¯ b (cid:48) j | j ∈ Z } . One can then constructthe model M as above. A.5 Proof of Proposition 8.2
Definition 19.
Say that a theory T is NIP if in every model M | = T , every formula ϕ ( ¯ x ; ¯ y ) hasfinite VC-dimension on M.By compactness, a class of structures C is NIP according to Definition 8 if and only if itstheory is NIP. The following is proved in [Sim21]. Proposition A.14.
Fix a theory T. Suppose that for every M | = T and for every formula ϕ ( x , y ) withparameters from M , ϕ ( x , y ) has finite VC-dimension on M . Then T is NIP. We show how Proposition 8.2 follows. We repeat its statement here.
Proposition.
The following conditions are equivalent for a class of structures D :– D is not NIP,– there is a formula ϕ ( x , y ; ¯ z ) such that for every n there is a structure M ∈ D and a tuple ¯ c ∈ M ¯ z such that ϕ ( M; ¯ c ) ⊆ M defines a binary relation of VC-dimension at least n;Proof. We show the top-down implication, the other being trivial.Assume D is not NIP. Then the theory T of D is not NIP. By Proposition A.14 there is aformula ϕ ( x , y ; ¯ z ) , a model M of T and a tuple ¯ c ∈ M ¯ z of parameters from M such that ϕ ( M; ¯ c ) has infinite VC-dimension on M.Fix an arbitrary n ∈ N . Consider the sentence ψ n expressing“there exists ¯ c such that ϕ ( x , y ; ¯ c ) defines a relation of VC-dimension at least n .”Then M satisfies ψ n . In particular, the sentence ¬ ψ n is not in T , so there is a model S ∈ D satisfying ψ n . This proves the top-down implication in Proposition 8.2. B Proof of Lemma 9.4
A family ( ϕ i ( x )) i ∈ I of formulas with parameters from N is pairwise inconsistent if for any distinct i , j ∈ I , the formula ϕ i ( x ) ∧ ϕ j ( x ) has no solution in N. For a sequence { ¯ a i | i < ω } and for i (cid:54) ω by ¯ a < i denote the set of elements in all the tuples ¯ a j with j < i .We prove a stronger variant of Lemma 9.4. Lemma.
Suppose C is not regular, as witnessed by formulas ϕ ( x , ¯ y ) , ψ ( x , ¯ z ) , θ ( ¯ u , ¯ v ) . Then there exist:– a structure M in the elementary closure of C , an elementary extension N of M ,– a sequence ( ¯ a i : i < ω ) of tuples in N ¯ y and a sequence ( ¯ b j : j < ω ) of tuples in N ¯ z ,such that the following properties hold:1. the tuples ¯ a , ¯ a , . . . have equal types over M , and the tuples ¯ b , ¯ b , . . . have equal types over M ,2. for all < i , j < ω , the set Types θ ( A / B ) is infinite, where A = ϕ ( N, ¯ a i ) and B = ψ ( N, ¯ b i ) ,3. ¯ a i || M ¯ a < i ¯ b < ω for i < ω ,4. the formulas { ϕ ( x ; ¯ a i ) | i < ω } are pairwise inconsistent,5. the formulas { ψ ( x ; ¯ b j ) | j < ω } are pairwise inconsistent. It is clear that each of the properties (1)-(4) implies the corresponding property stated inLemma 9.4. Properties (5) and (1) together imply that ψ ( M, ¯ b j ) = ∅ yielding property (5) inLemma 9.4. We thus prove the statement above. Proof.
Assume C is not regular. We proceed in two steps.Step 1. There is a model M in the elementary closure of C , indiscernible sequences ( ¯ a i : i < ω ) in M ¯ y and ( ¯ b j : j < ω ) in M ¯ z , formulas ϕ ( x , ¯ y ) , ψ ( x , ¯ z ) and θ ( ¯ u , ¯ v ) such that:– the families { ϕ ( x , ¯ a i ) | i < ω } and { ψ ( x , ¯ b j ) | j < ω } are both pairwise inconsistent– for each 0 (cid:54) i , j < ω the set Types θ ( A / B ) is infinite, where A = ϕ ( M, ¯ a i ) and B = ψ ( M, ¯ b j ) .As C is not regular, for every natural number m , we can find a structure M m ∈ C sequences ( ¯ a mi : i < m ) and ( ¯ b mj : j < m ) of tuples of M m such that: • the two families { ϕ ( ¯ x ; ¯ a mi ) : i < m } and { ψ ( x ; ¯ b mj ) : j < m } are pairwise disjoint; • for every i , j < m , the set Types θ ( A / B ) has size at least m , where A = ϕ ( M m ; ¯ a mi ) and B = ψ ( M m ; ¯ b mj ) .Add constants to the signature to name two sequences ( ¯ a i : i < ω ) and ( ¯ b j : j < ω ) .Consider the theory T (cid:48) in the extended language consisting of the following for every m < ω : • all sentences which hold in all structures in C ; • m for every i < j < m , the two sets ϕ ( ¯ x ; ¯ a i ) and ϕ ( ¯ x ; ¯ a j ) are disjoint and the two sets ψ ( x ; ¯ b i ) and ψ ( x ; ¯ b j ) are disjoint; • m the two sequences ( ¯ a i : i < m ) and ( ¯ b j : j < m ) are indiscernible; • m for every i , j < m the set Types θ ( A / B ) has size at least m , where A = ϕ ( M; ¯ a m ) and B = ψ ( M; ¯ b m ) and M is the considered model.Note that all those conditions are expressible by first order formulas (infinitely many in thecase of • and • m ).We claim that T (cid:48) is consistent. Let T ⊆ T (cid:48) be finite. Then there is m < ω such that T onlycontains formulas from T along with formulas • m (cid:48) , • m (cid:48) and • m (cid:48) for m (cid:48) ≤ m . Furthermore,there is a finite set ∆ of formulas such that the formulas from • appearing in T say at most that ( ¯ a i : i < m ) and ( ¯ b j : j < m ) are ∆ -indiscernible.By Lemma A.10, for m ∗ < ω is large enough, we can find a subsequences ( ¯ a (cid:48) i : i < m ) of ( ¯ a m ∗ i : i < m ) and a subsequence ( ¯ b (cid:48) i : i < m ) of ( ¯ b m ∗ i : i < m ∗ ) that are ∆ -indiscernible. But45hen M m ∗ where we interpret the constants so as to name the two sequences ( ¯ a (cid:48) i : i < m ) of ( ¯ a m ∗ i : i < m ) is a model of T . Hence T is consistent. As T was an arbitrary finite subset of T (cid:48) ,we conclude by compactness that T (cid:48) is consistent.Let M be a model of T (cid:48) and set I = ( ¯ a i : i < ω ) and J = ( ¯ b j : j < ω ) as interpreted in M.This yields the structure M as described in Step 1.Step 2. Apply Lemma A.13 to get an elementary extension N of M, an elementary substructureM (cid:48) of N, such that ( ¯ b j : j < ω ) is a Morley sequence over M (cid:48) ¯ a < ω and ( ¯ a i : j < ω ) is a Morleysequence over M (cid:48) ¯ b < ω . In particular:1. ( ¯ a i : i > ω ) and ( ¯ b j : j > ω ) are both indiscernible over M (cid:48) ,2. the families { ϕ ( x , ¯ a i ) | i < ω } and { ψ ( x , ¯ b j ) | j < ω } are both pairwise inconsistent,3. for each 0 (cid:54) i , j < ω the set Types θ ( A / B ) is infinite, where A = ϕ ( N, ¯ a i ) and B = ψ ( N, ¯ b j ) ,4. ¯ a i || M (cid:48) ¯ a < i ¯ b < ω .This finishes the proof of Lemma 9.4. C Proof of Proposition 8.6
Before proving Proposition 8.6, we prove some lemmas.The first lemma is a characterisation of theories that exclude large grids using mutuallyindiscernible sequences.
Lemma C.1.
Assume that in some model M there are two mutually indiscernible sequences ( ¯ a i : i < ω ) and ( ¯ b j : j < ω ) and a singleton c and for some formulas ϕ ( ¯ x , ¯ y ; z ) with parameters in M such that:– ϕ ( ¯ a , ¯ b ; c ) holds,– ¬ ϕ ( ¯ a i , ¯ b ; c ) holds for all i > ,– ¬ ϕ ( ¯ a , ¯ b j , c ) holds for all j > .Then the formula ψ ( ¯ x ¯ x (cid:48) , ¯ y ¯ y (cid:48) ; z ) ≡ ϕ ( ¯ x , ¯ y ; z ) ∧ ¬ ϕ ( ¯ x (cid:48) , ¯ y ; z ) ∧ ¬ ϕ ( ¯ x , ¯ y (cid:48) ; z ) defines large grids in M .Proof. By Proposition A.11, there are two sequences ( ¯ a (cid:48) i : i ∈ Z ) and ( ¯ b (cid:48) j : j ∈ Z ) in some elemen-tary extension of M which are mutually indiscernible and based on ( ¯ a i : i < ω ) and ( ¯ b j : j < ω ) .Since those latter sequences are already mutually indiscernible, we have tp (( ¯ a (cid:48) i ) i ∈ N ( ¯ b (cid:48) i ) i ∈ N ) = tp (( ¯ a i ) i < ω ( ¯ b i ) i < ω ) . It follows that we can find some ¯ a i , i ∈ Z − , and ¯ b i , i ∈ Z − so thattp (( ¯ a (cid:48) i ) i ∈ Z ( ¯ b (cid:48) i ) i ∈ Z ) = tp (( ¯ a i ) i ∈ Z ( ¯ b i ) i ∈ Z ) .In particular, the two sequences ( ¯ a i : i ∈ Z ) and ( ¯ b i : i ∈ Z ) are mutually indiscernible. Byremoving some points with negative indices, we may assume that either for all i < ϕ ( ¯ a i , ¯ b ; c ) holds for for all i < ¬ ϕ ( ¯ a i , ¯ b ; c ) holds and similarly for ϕ ( ¯ a , ¯ b j ; c ) .By mutual indiscernibility of the two sequences, for any ( k , l ) ∈ Z , we can find some c k , l inan elementary extension N of M such that: 46 ϕ ( ¯ a k , ¯ b l ; c k , l ) – ¬ ϕ ( ¯ a i , ¯ b l ; c k , l ) holds for i > k , and– ϕ ( ¯ a k , ¯ b j ; c k , l ) holds for j > l .Note that the points c k , l are necessarily pairwise distinct. Consider the formula ψ as in thestatement. Then ψ ( ¯ x ¯ x (cid:48) , ¯ y ¯ y (cid:48) ; z ) holds of a tuple ( ¯ a i ¯ a i + , ¯ b j ¯ b j + , c k , l ) if and only if ( i , j ) = ( k , l ) .Hence, ψ defines an infinite grid in N. As N is an elementary extension of M, the formula ψ alsodefines arbitrarily large grids in M. Lemma C.2.
Let M ≺ N be models. Let p ( ¯ x ) be a type with parameters in N , finitely satisfiable in M and ¯ a | = p | M . Let ¯ c ∈ N ¯ y be any tuple. Then there is r ( ¯ x , ¯ y ) ∈ S ( N ) a type finitely satisfiable in M extending p ( ¯ x ) ∪ tp ¯ x ¯ y ( ¯ a ¯ c /M ) .Proof. By Lemma A.6, it is enough to show that the partial type π ( ¯ x ; ¯ y ) = p ( ¯ x ) ∪ tp ¯ x ¯ y ( ¯ a ¯ c /M ) isfinitely satisfiable in M. Take θ ( ¯ x ) ∈ p ( ¯ x ) and ψ ( ¯ x ; ¯ y ) ∈ tp ( ¯ a ¯ c /M ) and we look for a realizationof θ ( ¯ x ) ∧ ψ ( ¯ x ; ¯ y ) in M. Consider the formula θ (cid:48) ( ¯ x ) = θ ( ¯ x ) ∧ ( ∃ ¯ y ) ψ ( ¯ x ; ¯ y ) . This formula is in p ( ¯ x ) ,hence as p is finitely satisfiable in M it has a realization ¯ a in M. Since M | = θ (cid:48) ( ¯ a ) holds, thereis ¯ c in M such that M | = ψ ( ¯ a ; ¯ c ) . Hence the pair ( ¯ a , ¯ c ) is a realization of θ ( ¯ x ) ∧ ψ ( ¯ x ; ¯ y ) asrequired.We are now ready to prove Proposition 8.6, which we reformulate below. Proposition.
Let M ≺ N be models. If there are tuples ¯ a ∈ N ¯ x , ¯ b ∈ N ¯ y be tuples and a single elementc ∈ N such that ¯ a || M ¯ b , ¯ ac (cid:45) | M ¯ b , ¯ a (cid:45) | M ¯ bc , then M defines large grids. More precisely, if α ( ¯ x , z ; ¯ b ) witnesses ¯ ac (cid:45) | M ¯ b and β ( ¯ x ; ¯ b , c ) witnesses ¯ a (cid:45) | M ¯ bcthen a boolean combination ψ of instances of α and β defines large grids in M .Proof. Let p ( ¯ x ) ∈ S ¯ x ( N ) be a type finitely satisfiable in M and extending tp ( ¯ a /M¯ b ) (cf. Lem. A.6).Let also q ( ¯ y ) ∈ S ¯ y ( N ) be a type finitely satisfiable in M extending tp ( ¯ b /M ) . Now, let p ( ¯ x ) ⊗ q ( ¯ y ) ∈ S ¯ x ¯ y ( N ) be a complete type finitely satisfiable in M extending tp ( ¯ a ¯ b /M ) (which is finitelysatisfiable in M by Lem. A.3). Finally, let r ( ¯ x , ¯ y , z ) be a type finitely satisfiable in M extending ( p ( ¯ x ) ⊗ q ( ¯ y )) ∪ tp ( ¯ a ¯ bc /M ) , obtained from Lemma C.2. Reassuming, r ( ¯ x , ¯ y , z ) is a type finitelysatisfiable in M extending tp ( ¯ a /M¯ b ) ∪ tp ( ¯ a ¯ bc /M ) , and p ( ¯ x ) and q ( ¯ y ) are its restrictions to ¯ x and¯ y , respectively.Let J = ( ¯ b j : j ∈ Z − ) be a Morley sequence of q ( ¯ y ) over M, where Z − denotes the negativeintegers. Let ¯ a (cid:48) ¯ b (cid:48) c (cid:48) | = r | M J . Then let I = ( ¯ a i : 0 < i < ω ) be a Morley sequence of p over J ¯ a (cid:48) ¯ b (cid:48) c (cid:48) .We then have that the sequences J + ( ¯ b (cid:48) ) and ( ¯ a (cid:48) ) + I are mutually indiscernible (the firstone is a Morley sequence of q over M and the second one is a Morley sequence of p over thefirst one).By assumption there are formulas α ( ¯ x , z ; ¯ y ) and β ( ¯ x ; ¯ y , z ) with parameters from M such that:– ¯ a ¯ bc satisfies α ∧ β ;– α ( ¯ x , y ; ¯ b ) is not safisfiable in M;– β ( ¯ x ; ¯ b , c ) is not safisfiable in M. 47he same holds true for ¯ a ¯ bc replaced by ¯ a (cid:48) ¯ b (cid:48) c as they have equal types over M. Then:– ( ¯ a (cid:48) , ¯ b (cid:48) , c (cid:48) ) satisfies α ∧ β ,– ¬ α ( ¯ a i , ¯ b (cid:48) , c ) holds for all 0 < i < ω ,– ¬ β ( ¯ a (cid:48) , ¯ b j , c (cid:48) ) holds for all − ω < j < α ∧ β yields the conclusion. References [AA14] Hans Adler and Isolde Adler. Interpreting nowhere dense graph classes as a clas-sical notion of model theory.
European Journal of Combinatorics , 36:322–330, 2014.[ALS88] Stefan Arnborg, Jens Lagergren, and Detlef Seese. Problems easy for tree-decomposable graphs extended abstract. In Timo Lepistö and Arto Salomaa, edi-tors,
Automata, Languages and Programming , pages 38–51, Berlin, Heidelberg, 1988.Springer Berlin Heidelberg.[BBM06] József Balogh, Béla Bollobás, and Robert Morris. Hereditary properties of orderedgraphs. In
Topics in discrete mathematics , pages 179–213. Springer, 2006.[BGdMT21] Édouard Bonnet, Ugo Giocanti, Patrice Ossona de Mendez, and StéphanThomassé. Twin-width iv: low complexity matrices, 2021.[BGK + ] Édouard Bonnet, Colin Geniet, Eun Jung Kim, Stéphan Thomassé, and Rémi Wa-trigant. Twin-width II: small classes , pages 1977–1996.[BGK +
20] Édouard Bonnet, Colin Geniet, Eun Jung Kim, Stéphan Thomassé, and Rémi Wa-trigant. Twin-width iii: Max independent set and coloring, 2020.[BKTW20a] É. Bonnet, E. J. Kim, S. Thomassé, and R. Watrigant. Twin-width i: tractable fomodel checking. In , pages 601–612, 2020.[BKTW20b] Édouard Bonnet, Eun Jung Kim, Stéphan Thomassé, and Rémi Watrigant. Twin-width i: tractable fo model checking. arXiv preprint arXiv:2004.14789 , 2020.[BM15] Simone Bova and Barnaby Martin. First-order queries on finite abelian groups.In . SchlossDagstuhl-Leibniz-Zentrum fuer Informatik, 2015.[Bod15] Manuel Bodirsky.
Ramsey classes: examples and constructions , pages 1–48. LondonMathematical Society Lecture Note Series. Cambridge University Press, 2015.[BS85] John T. Baldwin and Saharon Shelah. Second-order quantifiers and the complexityof theories.
Notre Dame J. Formal Log. , 26(3):229–303, 1985.[CiO07] Bruno Courcelle and Sang il Oum. Vertex-minors, monadic second-order logic,and a conjecture by seese.
Journal of Combinatorial Theory, Series B , 97(1):91–126,2007. 48CK16] Josef Cibulka and Jan Kyncl. Füredi-hajnal limits are typically subexponential.
CoRR , abs/1607.07491, 2016.[Cou94] Bruno Courcelle. Monadic second-order definable graph transductions: a survey.
Theoretical Computer Science , 126(1):53–75, 1994.[EK17] Kord Eickmeyer and Ken-ichi Kawarabayashi. Fo model checking on map graphs.In Ralf Klasing and Marc Zeitoun, editors,
Fundamentals of Computation Theory ,pages 204–216, Berlin, Heidelberg, 2017. Springer Berlin Heidelberg.[FG06] J. Flum and M. Grohe.
Parameterized Complexity Theory (Texts in Theoretical ComputerScience. An EATCS Series) . Springer-Verlag, Berlin, Heidelberg, 2006.[GHO +
20] Jakub Gajarský, Petr Hlinˇený, Jan Obdržálek, Daniel Lokshtanov, and M. S. Ra-manujan. A new perspective on fo model checking of dense graph classes.
ACMTrans. Comput. Logic , 21(4), July 2020.[GKS14] Martin Grohe, Stephan Kreutzer, and Sebastian Siebertz. Deciding first-order prop-erties of nowhere dense graphs. In
STOC 2014 , pages 89–98. ACM, 2014.[MT04] Adam Marcus and Gábor Tardos. Excluded permutation matrices and the stanley–wilf conjecture.
Journal of Combinatorial Theory, Series A , 107(1):153–160, 2004.[NOdM11] Jaroslav Nešetˇril and Patrice Ossona de Mendez. On nowhere dense graphs.
Eu-ropean Journal of Combinatorics , 32(4):600–617, 2011.[RS86] Neil Robertson and P.D Seymour. Graph minors. v. excluding a planar graph.
Jour-nal of Combinatorial Theory, Series B , 41(1):92–114, 1986.[She86] Saharon Shelah.
Monadic logic: Hanf Numbers. In: Around Classification Theory ofModels , volume vol 1182 of