# First order logic and twin-width in tournaments and dense oriented graphs

Colin Geniet, Stéphan Thomassé

► To cite this version:

Colin Geniet, Stéphan Thomassé. First order logic and twin-width in tournaments and dense oriented graphs. European Journal of Combinatorics, 2026, 132, pp.104247. 10.1016/j.ejc.2025.104247. hal-05426427

HAL Id: hal-05426427

https://hal.science/hal-05426427v1

Submitted on 19 Dec 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# FIRST ORDER LOGIC AND TWIN-WIDTH IN TOURNAMENTS AND DENSE ORIENTED GRAPHS

COLIN GENIET AND STÉPHAN THOMASSÉ

**ABSTRACT.** We characterise the classes of tournaments with tractable first-order model checking. For every hereditary class of tournaments $\mathcal{T}$, first-order model checking is either fixed parameter tractable or AW[*]-hard. This dichotomy coincides with the fact that $\mathcal{T}$ has either bounded or unbounded twin-width, and that the growth of $\mathcal{T}$ is either at most exponential or at least factorial. From the model-theoretic point of view, we show that NIP classes of tournaments coincide with bounded twin-width. Twin-width is also characterised by three infinite families of obstructions: $\mathcal{T}$ has bounded twin-width if and only if it excludes at least one tournament from each family. This generalises results of Bonnet et al. on ordered graphs.

The key for these results is a polynomial time algorithm that takes as input a tournament $T$ and computes a linear order $<$ on $V(T)$ such that the twin-width of the birelation ($T,<$) is at most some function of the twin-width of $T$. Since approximating twin-width can be done in polynomial time for an ordered structure ($T,<$), this provides a polynomial time approximation of twin-width for tournaments.

Our results extend to oriented graphs with stable sets of bounded size, which may also be augmented by arbitrary binary relations.

## 1. INTRODUCTION

1.1. **Parameterised problems in tournaments.** Tournaments can represent the outcome of a ranking procedure on a set of candidates, which in general need not be a total order. A well-known example is the Condorcet voting paradox, where three referees whose preference lists are $(A, B, C)$, $(B, C, A)$, and $(C, A, B)$ lead to a cycle $A \leftarrow B \leftarrow C \leftarrow A$ in the ‘preferred over’ relation. This interpretation leads to classical algorithmic problems when trying to choose winners. For instance the DOMINATING SET (DS) problem on tournaments asks for a subset $D$ that is collectively preferred to any other candidate, in the sense that for any $y \notin D$, there is $x \in D$ such that $x$ is preferred to $y$. The FEEDBACK VERTEX SET (FVS) problem attempts to build a preference order—i.e. an acyclic graph—over the candidates by ignoring a subset of candidates.

<footnote n="2020">2020 Mathematics Subject Classification. Primary 05C20; Secondary 05C85, 03C13, 05C30.</footnote>

<footnote>*Key words and phrases.* Tournaments, twin-width, first-order logic, model checking, NIP, small classes.</footnote>

<footnote>Both authors were supported by the ANR projects TWIN-WIDTH (ANR-21-CE48-0014-01) and DIGRAPHS (ANR-19-CE48-0013-01). The first author was supported by the Institute for Basic Science (IBS-R029-C1).</footnote>
One can consider the parameterised version of these problems, asking for a solution of size k—they are denoted by k-DS, k-FVS. A problem parameterised by k is fixed parameter tractable (FPT) if it admits an algorithm running in time $f(k) \cdot n^{O(1)}$ where n is the size of the input. For instance k-FVS is well-known to be FPT for tournaments (see Kumar and Lokshtanov [24]), whereas k-DS is probably not FPT. However general tournaments may not be representative of usual instances, for example, majority voting tournaments involving $2r + 1$ referees form a very restricted class. A cornerstone paper by Alon et al. [2], based on Vapnik-Chervonenkis dimension, shows that k-DS is trivially FPT on $(2r + 1)$-majority tournaments because the size of a minimum dominating set is at most some function $f(r)$. This exemplifies how difficult problems can become easy on restricted classes, and how complexity parameters (here bounded VC-dimension) can help to define classes of tournaments.

To put these questions in a much broader perspective, observe that the previous problems can be expressed in first-order logic (FO). The existence of a k-DS is described by the formula

$$ \exists x_1, x_2, \dots, x_k. \forall y. (y \to x_1) \lor \dots \lor (y \to x_k) $$

(assuming $x \to x$ for all $x$ for simplicity). That k-FVS is also expressible in first-order logic is worth mentioning, as this is only true in tournaments, and not in general graphs. It is based on the simple remark that a tournament is acyclic if and only if it is transitive, i.e. it has no directed 3-cycle—the latter condition is easily expressed in FO. This makes k-DS and k-FVS very specific instances of the FO MODEL CHECKING (or FOMC) problem, which given as input a tournament $T$ and a first-order formula $\phi$, asks if $T \models \phi$. FO model checking is AW[*]-hard on the class of all graphs [15], and thus conjectured not to be FPT. Using back-and-forth encodings expressible in first-order logic, one can show that the problem is just as hard in general tournaments. Thus, one cannot hope for substantial algorithmic results on first-order model checking for arbitrary tournaments. Instead, we study the classes of tournaments in which the problem is simple, meaning the classes of tournaments that admit an FPT algorithm for FO model checking parameterised by the size of the given formula.

## 1.2. Main results.
We prove a dichotomy: in any class of tournaments $\mathcal{T}$ (closed under taking subtournaments), FOMC is either FPT or AW[*]-hard. More precisely, we show that the key of this dichotomy is *twin-width*, a complexity parameter introduced by Bonnet et al. [7], defined on arbitrary binary structures. If $\mathcal{T}$ has bounded twin-width, then FOMC in $\mathcal{T}$ is FPT, whereas it is AW[*]-hard when $\mathcal{T}$ has unbounded twin-width. This dichotomy also coincides with a model theoretic characterisation: the class $\mathcal{T}$ has bounded twin-width if and only if it is (monadically) NIP, which roughly speaking means that arbitrary graphs cannot be described by use of tournaments in $\mathcal{T}$, and a fixed first-order formula. In the vocabulary of [11], this proves that tournaments are *delineated*: every subclass is NIP if and only if it has bounded twin-width, answering a question posed in [11]. The equivalence between NIP and FPT FO model checking also confirms the *nowhere FO dense* conjecture of Gajarský et al. [19] in the case of tournaments.
The dichotomy for FO model checking in tournaments also coincides with a gap in the growth function $g_T(n)$ of the class $T$, defined as the number of tournaments of $T$ with $n$ vertices counted up to isomorphism. We show that $T$ has bounded twin-width if and only if its growth is at most $c^n$ for some constant $c$. To the contrary, when twin-width is not bounded, the growth is at least ($\lfloor n/2 \rfloor - 1$)! This exponential/factorial gap can be seen as a generalization of the Marcus-Tardos theorem on permutations avoiding a fixed pattern [25]. It may also be compared to results of Boudabbous and Pouzet [12] showing that hereditary classes of tournaments have growth either at most polynomial or at least exponential—the growth being polynomial if and only if the class does not contain arbitrarily large tournaments with no acyclic modules.

The following theorem summarises our results.

**Theorem 1.1.** Let $\mathcal{T}$ be a hereditary class of tournaments. Assuming<fnref n="1" /> that $\mathrm{FPT} \neq \mathrm{AW}[*]$, the following are equivalent:

(1) $\mathcal{T}$ has bounded twin-width,

(2) FO model checking in $\mathcal{T}$ is FPT,

(3) FO model checking in $\mathcal{T}$ is not $\mathrm{AW}[*]$-hard,

(4) $\mathcal{T}$ does not FO interpret the class of all graphs,

(5) $\mathcal{T}$ is monadically NIP, i.e. does not FO transduce all graphs,

(6) the growth of $\mathcal{T}$ is at most $c^n$ for some constant $c$,

(7) the growth of $\mathcal{T}$ is less than ($\lfloor \frac{n}{2} \rfloor - 1$)!

These equivalences are completed by three minimal classes of obstructions, characterising twin-width in terms of excluded substructures. These excluded tournaments are encodings of arbitrary permutations.

**Theorem 1.2.** There are three obstruction classes $\mathcal{F}=, \mathcal{F}\leq, \mathcal{F}\geq$ such that a hereditary class $\mathcal{T}$ of tournaments has unbounded twin-width if and only if one of $\mathcal{F}=, \mathcal{F}\leq, \mathcal{F}\geq$ is contained in $\mathcal{T}$.

Finally, we show that there is a fixed parameter tractable algorithm that approximates twin-width of tournaments up to some function.

**Theorem 1.3.** There are functions $f, g: \mathbb{N} \to \mathbb{N}$ and an algorithm that given a tournament $T$ with twin-width $k$, produces a witness that the twin-width of $T$ is at most $f(k)$ in FPT time $g(k) \cdot |T|^{O(1)}$.

This algorithm is crucial to obtain the FPT FO model checking algorithm in classes with bounded twin-width.

The former three theorems generalise to oriented graphs with independence number bounded by some fixed constant. Furthermore, the tournaments (or oriented graphs with bounded independence) can be augmented by any fixed number of arbitrary binary relations: the theorems still hold for the resulting class of binary relational structures. In particular, this work generalises the analogous results of [9] on ordered graphs and ordered binary structures: we replace linear orders with tournaments. In these generalisations, however, the classes of obstructions for Theorem 1.2 are more numerous, and we do not give precise descriptions.

<footnote n="1">¹The assumption is only used for conditions 2 and 3.</footnote>
1.3. **Overview of the proof.** A fundamental idea regarding twin-width is that upper bounds on twin-width can be witnessed by orders on vertices that exclude grid-like structures in the adjacency matrix. This idea appears in the founding works of Guillemot and Marx [23] and Bonnet et al. [7], and the relation between twin-width and orders has been deeply explored in [9]. However it is difficult to provide witnesses for lower bounds on twin-width using this approach: one needs to somehow prove that all orders contain grids. To this purpose, we want to construct an order < in any given tournament T, such that when T has small twin-width, < is a witness of this fact. That is, if T has twin-width k, then the bi-relation (T, <) should have twin-width at most f(k) for some function f.

A tentative approach to obtain such an order is to describe it in FO logic—that is, to give an FO transduction that produces a total ordering on any given tournament. Indeed, FO transductions preserve twin-width up to some function [7, Theorem 39]. Thus, if there is a universal transduction $\Phi$ computing some order < on any tournament T, then we obtain $tww(T, <) \le f(tww(T))$ as desired. With such a transduction, and some additional requirements such as < being efficiently computable, it would be straightforward to obtain our results from the known case of ordered graphs [9]. Unfortunately, this approach fails: to transduce a total order on an iterated lexicographic product of the 3-cycle with itself, one needs a first-order formula with size increasing in the number of iterations [5]. This class of counter-examples also has twin-width 1, meaning that it is not even possible to transduce an order on the class of tournaments of twin-width k for a fixed k.

Instead, our approach is the following: we design a candidate total order < on T, computable in polynomial time. If the bi-relation (T, <) has small twin-width, we are done. On the other hand, if (T, <) has large twin-width, then its adjacency matrix w.r.t. < must contain a large high-rank grid by [9]. We then extract a subtournament $T' \subset T$ in which the adjacency matrix w.r.t. < still has a substantial (but logarithmically smaller) high-rank grid, and on which < is described by an FO transduction. This is enough to witness that T has large twin-width. Using Ramsey arguments, we are also able to extract from $T'$ some obstruction from one of the classes $F_=$, $F_{\le}$, $F_{\ge}$.

The construction of the order is simple: we consider a binary search tree (BST) on the vertex set, i.e. a tree in which the left, resp. right, branch of a node x consists only of in-, resp. out-neighbours of x. The order < is the left-to-right order on nodes of the tree. The extraction of smaller high-rank grids corresponds to the choice of a branch B, and the restriction of < to the relevant subtournament is a lexicographic ordering according to B.

To summarise, the crucial property of BST orders is the following.

**Lemma 1.4.** *There is a function f such that for any tournament T and any BST order <,*

$$tww(T, <) \le f(tww(T)).$$

Lemma 1.4 implies Theorem 1.3: to approximate the twin-width of T, it suffices to compute any BST order—this takes polynomial time—and then
apply the approximation algorithm for ordered structures [9, Theorem 7]—
this is fixed parameter tractable. This last algorithm produces either a con-
traction sequence (which is valid for (T, <) and a fortiori for T) or a witness
that (T, <) has large twin-width, which in turn implies that T has large
twin-width by Lemma 1.4.

Our main technical result is about extracting the three classes of ob-
structions to twin-width F=, F≤, F≥, consisting of encodings of arbitrary
permutations into tournaments. See section 3 for the definition.

**Theorem 1.5.** Let $\mathcal{T}$ be a hereditary class of tournaments such that for any $k$, there is a tournament $T \in \mathcal{T}$ and a BST ordering $<$ of $T$ with $tww(T, <) > k$. Then $\mathcal{T}$ contains one of the classes $F_=$, $F_≤$, $F_≥$ as a subclass.

We also prove that the classes $\mathcal{F}_=$, $\mathcal{F}_\le$, $\mathcal{F}_\ge$ are complex in all the senses considered by Theorem 1.1, that is

**Theorem 1.6.** For each $R \in \{=, <, \ge\}$, the class $\mathcal{F}_R$

(1) has unbounded twin-width,

(2) contains at least ($\lfloor \frac{n}{2} \rfloor - 1$)! tournaments on $n$ vertices counted up to isomorphism,

(3) contains at least ($\lfloor \frac{n}{2} \rfloor - 1)! \cdot n!$ tournaments on vertex set $\{1, \dots, n\}$ counted up to equality,

(4) efficiently interprets the class of all graphs,

(5) and has an AW[*]-hard FO model checking problem.

Theorems 1.5 and 1.6 together imply Theorem 1.2. By applying them to the class of tournaments with twin-width at most $k$, they also imply Lemma 1.4: this class cannot contain any of $\mathcal{F}_=, \mathcal{F}_\le, \mathcal{F}_\ge$, hence its tournaments must still have bounded twin-width when paired with BST orders. Finally, Theorems 1.2 and 1.6 directly imply that if $\mathcal{T}$ is a hereditary class with unbounded twin-width, then $\mathcal{T}$ satisfies none of the conditions of Theorem 1.1. The remaining implications of Theorem 1.1—that is, when $\mathcal{T}$ has bounded twin-width, all other conditions hold—follow from known results on twin-width. By [7, Theorem 1], FO model checking has an FPT algorithm when a witness of bounded twin-width is given. Combined with Theorem 1.3, we obtain an FPT algorithm for classes of tournaments with bounded twin-width. By [7, Theorem 39], a class of structures with bounded twin-width cannot transduce all graphs. Finally, by [6, Corollary 7.3], a class of structures with bounded twin-width contains at most $c^n$ structures on $n$ vertices up to isomorphism, for some constant $c$ depending on the class.

**1.4. Context and related works.** An important question is how twin-width compares with other classical complexity measures for tournaments. Bounded twin-width implies bounded Vapnik-Chervonenkis dimension: indeed unbounded VC-dimension implies all possible bipartite tournaments appearing as subgraphs, which is against single-exponential growth, and thus twin-width is unbounded. The notion of *cutwidth* was introduced by Chudnovsky, Fradkin and Seymour [14] to study tournament immersions. The vertex ordering used to certify that cutwidth is bounded can be shown to exclude grids, meaning that it is a witness of bounded twin-width. Another
parameter, closely related to subdivisions in tournaments, is *pathwidth*, studied by Fradkin and Seymour [18]. Bounded pathwidth of tournaments implies bounded cliquewidth, which in turn also implies bounded twin-width, see [7]. Thus, we have the following chain of inclusions of complexity parameters (if a parameter is bounded, all the ones listed after are also bounded): cutwidth, pathwidth, cliquewidth, twin-width, and VC-dimension. For more on the subject, we recommend reading the work of Fomin and Pilipczuk [17, 27].

Our results are a direct generalisation of those of [9], from ordered graphs to tournaments. This generalisation is non-trivial: as explained in section 1.3, one cannot FO transduce orders from arbitrary tournaments—which would be the obvious way to reduce the problem from tournaments to ordered graphs. On the other hand, there is a natural way to form a tournament $T$ from an ordered graph $(G, <)$, namely $x \to y$ is a directed edge in $T$ if and only if $x < y$ and $xy$ is an edge of $G$, or $y < x$ and $xy$ is not an edge of $G$. This gives a way to create tournaments with bounded twin-width: starting with any graph $G$ with bounded twin-width, consider a total order $<$ on its vertices that is a witness of its twin-width, and interpret $T$ from $(G, <)$ as before. This paper can be seen as the reverse operation, that is a way of producing an order $<$ from a tournament $T$.

The binary search tree we use to order tournaments correspond to the KWIKSORT algorithm of Ailon, Charikar and Newman for approximating the minimum feedback arc set [1]. The only difference is that their result requires the BST to be randomly chosen, whereas arbitrary BST provide approximations of twin-width.

The generalization to oriented graphs with bounded independence number contains in particular partially ordered sets with bounded width (i.e. antichains of bounded size). These classes in fact always have bounded twin-width, see Balabán and Hlinený [3], and before that were already known to be tractable with respect to FO model checking, see Gajarský et al. [20].

Finally let us mention another notable result on tournaments of bounded twin-width: the polynomial time isomorphism test of Grohe and Neuen [22]. Their algorithm is remarkable in that it leverages twin-width without needing or manipulating a contraction sequence witness of twin-width. The techniques involved are very different from ours.

**1.5. Organisation of the paper.** Section 2 summarises definitions and notations used in this paper. In section 3 we define the classes $\mathcal{F}_=$, $\mathcal{F}_{\leq}$, $\mathcal{F}_{\geq}$ of obstructions to twin-width in tournaments, and prove Theorem 1.6. Section 4 introduces binary search trees, and proves a crucial lemma, which from a partition into intervals of a BST order, extracts some FO definable ordered substructure. Section 5 combines this key lemma with results of [9] to prove Lemma 1.4: from a witness that the tournament $T$ augmented by a BST order has large twin-width, the key lemma extracts a witness that $T$ itself has large twin-width. Section 6 refines this argument into a proof of Theorem 1.5 using Ramsey results. Finally, section 7 explains how our results generalise to oriented graphs with bounded independence number, and to binary relational structures.
## 2. PRELIMINARIES

This section summarises the notions and notations used in this work. For $n \in \mathbb{N}$, we denote by $[n]$ the interval of integers $\{1, \dots, n\}$. All the graphs, matrices, and relational structures considered in this work are finite.

### 2.1. Graphs, Oriented graphs, Tournaments.
A directed graph $D$ consists of a vertex set $V(G)$, and a set $E(G)$ of directed edges (also called arcs), which are ordered pairs of vertices. A directed edge $(u, v)$ is simply denoted by $uv$, or sometimes $u \to v$ to insist on the orientation. In this work, we do not consider loops, i.e. edges of the form $v \to v$. The underlying graph of $D$ is the undirected graph with the same vertices, and an edge $uv$ whenever either $uv$ or $vu$ is an edge of $D$. A digon in a directed graph is a pair of vertices $u, v$ with both edges $u \to v$ and $v \to u$. An oriented graph is a directed graph without digons.

A tournament is an oriented graph whose underlying graph is complete, or equivalently it is a choice of orientation $u \to v$ or $v \to u$ (but not both) for every pair of vertices. A tournament is transitive if it contains no directed cycle. A transitive tournament represents some order $<$ on vertices: there is an edge $u \to v$ if and only if $u < v$. In a directed graph $D$, a subset $X \subset V(D)$ that induces a transitive tournament is also called a chain.

A (directed) graph $H$ is an induced subgraph of $G$ if $V(H) \subset V(G)$, and the edges of $H$ are exactly the edges of $G$ that are between vertices of $V(H)$. If $X = V(H)$, we also say that $H$ is the subgraph of $G$ induced by $X$, denoted $H = G[X]$. A class of graphs is a family of graphs closed under isomorphism. A class is hereditary if it is also closed under taking induced subgraphs.

A subset $S$ of a (directed) graph is called *independent* or *stable* if no edge joins two vertices of $S$. The independence number $\alpha(G)$ is the maximum size of an independent set in $G$. For a vertex $x$ in a directed graph $D$, the *out-neighbourhood* is $N^+(x) = \{y \mid x \to y\}$, and the *in-neighbourhood* is $N^-(x) = \{y \mid y \to x\}$. Their union is the *complete neighbourhood* $N(x) = N^+(x) \cup N^-(x)$.

### 2.2. Relational structures.
Relational structures are a natural generalisation of graphs. A relational signature is a finite set $\Sigma$ of relation symbols $R$, each with an associated arity $r \in \mathbb{N}$. A relational structure $S$ over $\Sigma$, or simply $\Sigma$-structure, consists of a domain $A$, and for each relation symbol $R \in \Sigma$ of arity $r$, an interpretation of $R$ as $R^S \subseteq A^r$. One may think of $A$ as a set of vertices, and each $R^S$ as a set of hyperedges. The notions of induced substructure, hereditary classes, etc. generalise to relational structures in the obvious way.

We will only consider *binary* relational structures, i.e. over signatures where all symbols have arity 2. Directed graphs are binary structures with a single relation for edges.

An *ordered structure* $S$ is a structure over a relation $\Sigma$ with a special symbol, typically denoted `<`, whose interpretation $<^S$ is a strict total order on the domain of $S$.
**2.3. Orders, Quasi-orders.** A quasi-order $\leq$ is a reflexive and transitive binary relation. Any quasi-order induces an equivalence relation $x \sim y$ defined as $x \leq y \wedge y \leq x$, which is trivial if and only if $\leq$ is an order. One can also describe a quasi-order by giving this equivalence relation, and the order on the equivalence classes. The strict component of the quasi-order is defined by $x \prec y$ if and only if $x \leq y$ and $y \not\leq x$. The quasi-order is total if for all $x, y$, either $x \leq y$ or $y \leq x$.

An interval of a quasi-order $\leq$ is a set of the form $\{z \mid x \leq z \leq y\}$ for some $x, y$, called *endpoints* of the interval. Remark that an interval is always a union of equivalence classes of $\sim$.

**2.4. Matrices.** As is common in the context of permutations and patterns, we use the convention that matrix coordinate are oriented as in the euclidean plane. That is, coordinate $(i, j)$ means column $i$ and row $j$, with the bottom-most row being the smallest.

A matrix is seen as a map $M : C \times R \to \Gamma$, where $C, R$ are *ordered sets* of columns and rows of the matrix, and $\Gamma$ and its alphabet. The order of rows and columns is very important in the context of twin-width. Usually, the alphabet will simply be $\{0, 1\}$. The value $M(x, y)$ is called the *entry* at position $(x, y)$, and an $a$-entry means an entry whose value is $a$. A submatrix of $M$ is the restriction of $M$ to some subsets of rows and columns. The notion is comparable to that of induced substructure, thinking of rows and columns as vertices, and of the content of the matrix as a relation. Accordingly, a class of matrices is called *hereditary* if it is closed under submatrices.

Given a (directed) graph $G$ and a total order $<$ on $V(G)$, the adjacency matrix $A_{(G, <)}$ is a 0,1-matrix with rows and columns $V(G)$, with a ‘1’ at position $(u, v)$ if and only if $uv$ is an edge of $G$. Note that we do not use the common alternative definition for oriented graphs which places ‘$-1$’ at position $(u, v)$ when $u \leftarrow v$ instead is an edge. Adjacency matrices generalise easily to binary relational structures over any signature $\Sigma$, the alphabet being $\{0, 1\}^\Sigma$ in this case.

A *division* $\mathcal{D}$ of a matrix consist of partitions $\mathcal{R}, \mathcal{C}$ of its rows and its columns respectively into *intervals*. It is a $k$-division if the partitions have $k$ parts each. A *cell* of the division is the submatrix induced by $X \times Y$ for some $X \in \mathcal{R}, Y \in \mathcal{C}$. A $k$-grid in a 0,1-matrix is a division in which every cell contains a ‘1’-entry.

**2.5. Permutations.** We denote by $\mathfrak{S}_n$ the group of permutations on $n$ elements. The *permutation matrix* $M_\sigma$ of $\sigma \in \mathfrak{S}_n$ is the sparse $n \times n$ matrix with a ‘1’ at position $(i, j)$ if and only if $j = \sigma(i)$.

A permutation $\tau$ is a *pattern* of $\sigma$ if $M_\tau$ is a submatrix of $M_\sigma$. Any pattern $\tau$ of $\sigma$ is obtained by restricting $M_\sigma$ to columns in $X$ and rows in $\sigma(X)$ for some subset $X$ of the domain of $\sigma$. We then say that $\tau$ is the pattern of $\sigma$ *induced* by $X$.

We say that $\sigma$ contains a $k$-grid if $M_\sigma$ contains a $k$-grid. When this is the case, any permutation in $\mathfrak{S}_k$ is a pattern of $\sigma$. For example, the permutation $\sigma$ on $k^2$ elements defined by $\sigma(ki + j + 1) = kj + i + 1$ for any $0 \le i, j < k$ contains a $k$-grid. Grids in permutations are deeply related
to pattern-closed classes of permutations, which are precursors of the work on twin-width, see Marcus and Tardos [25] and Guillemot and Marx [23].

**Lemma 2.1.** If the permutation $\sigma \in \mathfrak{S}_n$ contains a k-grid, then so do its inverse $\sigma^{-1}$, and the reverse $i \mapsto n - \sigma(i) + 1$ and $i \mapsto \sigma(n - i + 1)$.

*Proof.* These operations correspond to transposing or mirroring the permutation matrix respectively, which clearly preserves the presence of k-grids. $\square$

**Lemma 2.2.** Consider a permutation $\sigma \in \mathfrak{S}_n$ with a $(k+1)$-grid, and $x \in [n]$ any element of its domain. Then the pattern of $\sigma$ induced by $[n] \setminus \{x\}$ contains a k-grid.

*Proof.* In the matrix $M_\sigma$, the pattern induced by $[n] \setminus \{x\}$ corresponds to removing column $x$ and row $\sigma(x)$. Removing a single column and single row of the matrix affects only one interval of columns and one interval of rows in the $(k+1)$-grid, leaving a k-grid. $\square$

**Lemma 2.3.** Consider a permutation $\sigma \in \mathfrak{S}_n$ with a 2k-grid, and $X \subset [n]$ such that the pattern of $\sigma$ induced by $X$ is either increasing or decreasing. Then the pattern of $\sigma$ induced by $[n] \setminus X$ contains a k-grid.

*Proof.* Call $R_1 < \dots < R_{2k}$ and $C_1 < \dots < C_{2k}$ the row intervals and column intervals in the 2k-grid of $\sigma$. Merge them two-by-two, as $R'_i = R_{2i-1} \cup R_i$ and $C'_i = C_{2i-1} \cup C_i$. Thus each cell $R'_i \times C'_j$ contains a 2-grid.

Say that a 1-entry in $M_\sigma$ comes from $X$ if it is at position $(i, \sigma(i))$ for some $i \in X$. Since the pattern induced by $X$ is increasing or decreasing, it cannot contain a 2-grid. Thus each cell $R'_i \times C'_j$ contains a 1-entry that does not come from $X$. Therefore $R'_1, \dots, R'_k$ and $C'_1, \dots, C'_k$ give a k-grid after removing the 1-entries from $X$, hence a k-grid in the matrix of the pattern induced by $[n] \setminus X$ as desired. $\square$

A permutation can be represented as a *bi-order*, i.e. the superposition of two total orders. Precisely, for $\sigma \in \mathfrak{S}_n$, the structure $\mathcal{O}_\sigma$ has domain $[n]$, and has for relations the natural order $<$, and the permuted order $<_\sigma$ defined as $i <_\sigma j$ if and only if $\sigma(i) < \sigma(j)$. Any bi-order is isomorphic to some $\mathcal{O}_\sigma$. Remark that $\tau$ is a pattern of $\sigma$ if and only if $\mathcal{O}_\tau$ is isomorphic to an induced substructure of $\mathcal{O}_\sigma$. We write $\mathcal{O}_\mathfrak{S}$ for the class of all finite bi-orders.

For any numbers $x, y$ let the order type $ot(x, y)$ be 1 if $x < y$, -1 if $x > y$, and 0 if $x = y$. We also write $ot_\sigma(x, y)$ for $ot(\sigma(x), \sigma(y))$, the order type with regards to the permuted order $<_\sigma$. In a bi-order $\mathcal{O}_\sigma = ([n], <, <_\sigma)$, consider a colouring of pairs $\lambda : [n]^2 \to \Gamma$ for some finite alphabet $\Gamma$. We say that this colouring *depends only on the orders* $<, <_\sigma$ if there is a $\eta : \{-1, 0, 1\}^2 \to \Gamma$ such that $\lambda$ factors as

$$ \lambda(x, y) = \eta(ot(x, y), ot_\sigma(x, y)) $$

For example, seeing the edges of a graph on $[n]$ as a colouring, the permutation graph with an edge $xy$ if only if $(x < y \land x >_\sigma y)$ or $(x > y \land x <_\sigma y)$ is one which only depends on $<$ and $<_\sigma$.

The following result of Ramsey theory, stated as such in [9, Lemma 18], will be used extensively to extract the minimal classes of obstructions in tournaments with large twin-width. It is a corollary of the *product Ramsey theorem*, see [4, Proposition 3.3] or [21, page 97].
**Lemma 2.4.** For any permutation $\sigma$ and any finite alphabet $\Gamma$, there is a permutation $\tau$ satisfying the following. Write the border $O_\tau$ as $([N], <, <_\tau)$. For any colouring of pairs $\lambda : [N]^2 \to \Gamma$, there exists $X \subset N$ such that the substructure $O_\tau[X]$ is isomorphic to $O_\sigma$, and the colouring $\lambda$ restricted to $X$ only depends on the orders $<, <_\tau$.

When the colouring $\lambda$ represents the edges of a tournament on $[n]$, that is $\lambda(x, y) = 1$ if and only if $x \to y$ is an edge, the ‘depends only on $<, <_\sigma$’ conditions becomes particularly useful.

**Lemma 2.5.** Let $T$ be a tournament and $<_1, <_2$ two orders on $V(T)$ such that the direction of edges of $T$ only depends on $<_1, <_2$. Then $T$ is transitive, and the direction of edges coincides with one of $<_1, <_2$, the reverse of $<_1$, or the reverse of $<_2$.

*Proof.* Let $\eta : \{-1, 0, 1\}^2 \to \{0, 1\}$ be a function such that such that $\lambda$ factors as $\lambda(x, y) = \eta(\mathrm{ot}(x, y), \mathrm{ot}_\sigma(x, y))$. Since $T$ is a tournament, it is then simple to verify that $\eta(-1, -1) = 1 - \eta(1, 1)$ and $\eta(-1, 1) = 1 - \eta(1, -1)$. It follows that the value of $\eta$ only actually depends on one of the two coordinates. It is then simple to verify that $T$ is transitive, with either the same order or the reverse of the order corresponding to this coordinate. $\square$

**2.6. Twin-width.** We recall the definition of twin-width for the sake of completeness, however we will not use it directly, relying on higher level results instead.

In a binary relational structure $S$, two disjoint subsets $X, Y$ of the domain are homogeneous if for all relations $R$ of $S$, if there are $x \in X, y \in Y$ with $xRy$, then for all $x' \in X, y' \in Y$, $x'Ry'$, and symmetrically. Thus, the relations between $X$ and $Y$ do not distinguish any vertex. For example, in a graph, $X, Y$ are homogeneous if and only if the bipartite graph between $X$ and $Y$ is either empty or complete; and in a tournament, $X$ and $Y$ are homogeneous if and only if all edges are oriented from $X$ to $Y$, or all from $Y$ to $X$.

A contraction sequence for a structure $S$ is a sequence $P_n, \dots, P_1$ of partitions of the domain of $S$, where $P_n$ is the partition into singletons, $P_1$ is the partition in a single part, and $P_i$ is obtained by merging two parts of $P_i$. For a given part $X \in P_i$, the error degree of $X$ in $(S, P_i)$ is the number of parts $Y \in P_i \setminus \{X\}$ that are not homogeneous to $X$. The width of the contraction sequence is the maximum error degree of $X$ in $(S, P_i)$ over all choices of $i \in [n]$ and $X \in P_i$. Finally, the twin-width of $S$, denoted tww$(S)$, is the minimum width of a contraction sequence for $S$.

Twin-width is characterised by grid-like structures in adjacency matrices. Recall that a division of a matrix is a partition of rows and columns into intervals. Then, a *rank-k division* is a k-division in which every cell has rank at least k. Bonnet et al. proved

**Theorem 2.6** ([9, Theorem 7]). There are functions $f, g$ such that for any graph (or binary structure) $G$ and any order $<$ on $V(G)$,

* if tww$(G, <) \ge f(k)$, then the matrix $A_{(G,<)}$ has a rank-k division, and

* if the matrix $A_{(G,<)}$ has a rank-g(k) division, then tww$(G, <) \ge k$.
Furthermore there is an FPT algorithm which given $G, <$, and $k$, finds either a rank-k division in $A_{(G,<)}$ or a contraction sequence of width $f(k)$ for $(G,<)$.

**2.7. First-order logic.** We assume general familiarity with first-order logic on graphs and relational structures. Recall from the introduction that we are primarily interesting in the FIRST-ORDER MODEL CHECKING algorithmic problem, which asks given as input a structure $S$ and a first-order formula $\phi$, if $\phi$ is satisfied by $S$, which is denoted by $S \models \phi$. We consider the complexity of this problem parameterised by the size $|\phi|$. In general, this problem is AW[*]-complete [15, Theorem 1]. In fact, the proof shows more precisely that

**Theorem 2.7 ([15, Proposition 2]).** *FIRST-ORDER MODEL CHECKING on the class of all graphs is AW[*]-complete.*

On classes of structures with bounded twin-width, FO model checking is FPT as long as a witness of twin-width is given.

**Theorem 2.8 ([7, Theorem 1]).** *There is an algorithm that, given a binary structure $S$ on $n$ vertices, a contraction sequence of width $k$ for $S$, and an FO formula $\phi$, decides if $S \models \phi$ in time $f(k, \phi) \cdot n$.*

*Interpretations and transductions* are ways to describe transformations of structures using logical formulæ. For two relational signatures $\Sigma, \Delta$, an FO interpretation $\Phi$ from $\Sigma$ to $\Delta$ consists of, for each relation $R \in \Delta$ of arity $r$, an FO formula $\phi_R(x_1, \dots, x_r)$ over the language $\Sigma$, and one last formula $\phi_{dom}(x)$ again over $\Sigma$. Given a $\Sigma$-structure $S$, the result $\Phi(S)$ of the interpretation is the $\Delta$-structure obtained by

* choosing the same domain as $S$,

* interpreting each relation $R \in \Delta$ as the set of tuples $(v_1, \dots, v_r)$ such that $S \models \phi_R(v_1, \dots, v_r)$,

* and finally taking the substructure induced by $\{v \mid S \models \phi_{dom}(v)\}$.

For instance, the square of a graph $G$ is defined as the graph with vertices $V(G)$, and in which $x, y$ are adjacent if and only if their distance in $G$ is at most 2. This is a first-order interpretation in which the edge relation is interpreted by the formula

$$ \phi(x, y) = x \neq y \land (E(x, y) \lor \exists z. E(x, z) \land E(z, y)) $$

where $E(x, y)$ denotes adjacency. The domain formula is trivial since we do not wish to delete vertices in this interpretation. It is well-known that the composition of two FO interpretations can itself be written as an FO interpretation.

*Transductions* generalise interpretation with a non-deterministic colouring step. Consider relational signatures $\Sigma$ and $\Sigma^+$, where $\Sigma^+$ consists of $\Sigma$ augmented by $r$ new unary relations $C_1, \dots, C_r$. If $S$ is a structure over the signature $\Sigma$, we denote by $S^+$ the set of structures over $\Sigma^+$ whose domain and interpretation of $\Sigma$ coincide with that of $S$. Thus, a $T \in S^+$ is uniquely described by the interpretation of $C_1, \dots, C_r$ within $V(S)$. A FO transduction $\Phi: \Sigma \to \Delta$ is described by the choice of $\Sigma^+$ augmenting $\Sigma$ with unary
relations, together with an FO interpretation $\Phi_I$ from $\Sigma^+$ from $\Delta$. The result of the transduction $\Phi$ on a $\Sigma$-structure $S$ is then the set of structures

$$ \Phi(S) = \{\Phi_I(T) \mid T \in S^+\} $$

Additional operations such as duplication of vertices are often allowed in transductions, but these will not be needed in this work. Like interpretations, transductions can be composed.

Given classes $C$, $D$ of relational structures, we say that $C$ interprets (resp. transduces) $D$ if there is an FO interpretation (resp. transduction) $\Phi$ such that $\Phi(C) \supseteq D$. The interpretation $\Phi$ is allowed to also output structures that are not in $D$. We furthermore say that $C$ efficiently interprets $D$ if there is also an algorithm that given as input $D \in D$, finds in polynomial time some $C \in C$ such that $\Phi(C) = D$. It is straightforward to show that this additional condition gives an FPT reduction for model checking.

**Lemma 2.9.** If $C$ efficiently interprets $D$, then there is an FPT reduction from FO MODEL CHECKING on $D$ to FO MODEL CHECKING on $C$.

Recall that $O_S$ denotes the class of bi-orders, which are encodings of permutations. The following is a folklore result, see e.g. [9, Lemma 12] for a very similar claim.

**Lemma 2.10.** The class $O_S$ of bi-orders efficiently interprets the class of all graphs.

Thus, using Lemma 2.9 and Theorem 2.7, FO MODEL CHECKING on $O_S$ is AW[*]-complete.

FO transductions also preserve twin-width, up to some function.

**Theorem 2.11** ([7, Theorem 39]). If $S$ is a class of binary structures with bounded twin-width and $\Phi$ is an FO transduction defined on $S$, then $\Phi(S)$ also has bounded twin-width.

A class of structures $S$ is said to be monadically NIP if $S$ does not transduce the class of all graphs. Since the class of all graphs does not have bounded twin-width, Theorem 2.11 implies that classes with bounded twin-width are monadically NIP. The weaker notion of (non-monadically) NIP also exists, with a slightly more technical definition. Braunfeld and Laskowski recently proved that NIP and monadically NIP are equivalent notions for hereditary classes of structures [13], thus the distinction is irrelevant in this work.

The following remarkable conjecture of Gajarsky et al. relates NIP classes and model checking.

**Conjecture 2.12** ([19, Conjecture 8.2]). A hereditary class of graphs has an FPT algorithm for first-order model checking if and only if it is NIP.

The first implication of Conjecture 2.12 was recently proved by Dreier, Mählmann, and Toruńczyk [16], under the assumption AW[*] ≠ FPT: they show that if $C$ is hereditary and transduces the class of all graphs, then it in fact efficiently interprets all graphs, hence model checking in $C$ is AW[*]-complete by Lemma 2.9. The converse implication (finding a model checking algorithm in NIP classes) is open.

Our main result confirms Conjecture 2.12 for tournaments.
**2.8. Enumerative combinatorics.** A class $\mathcal{S}$ of graphs (or binary relational structures) is small if there exists $c$ such that $\mathcal{S}$ contains at most $c^n \cdot n!$ structures on the vertex set $[n]$. For instance, the class of trees is small, and more generally proper minor closed classes of graphs are small as shown by Norine et al. [26]. This was further generalised to classes of bounded twin-width by Bonnet et al.

**Theorem 2.13 ([8, Theorem 2.4]).** *Classes of structures with bounded twin-width are small.*

The reverse implication does not hold for graphs: there are small hereditary classes of graphs with unbounded twin-width [10]. These counterexamples have bounded maximum degree. One of the main results of [9] is that for classes of ordered graphs, bounded twin-width is equivalent to being small. We generalise it to tournaments.

One may also count structures up to isomorphism instead of counting labelled structures as in the definition of small classes. A strengthening of Theorem 2.13 when counting up to isomorphism was proved in [6].

**Theorem 2.14 ([6, Corollary 7.3]).** *For any class $\mathcal{C}$ of structures with bounded twin-width, there is a constant $c$ such that $\mathcal{C}$ has at most $c^n$ structures on $n$ vertices counted up to isomorphism.*

### 3. FORBIDDEN CLASSES OF TOURNAMENTS

This section defines the three minimal classes $\mathcal{F}_=$, $\mathcal{F}_\leq$, and $\mathcal{F}_\geq$ of obstructions to twin-width in tournaments. Each of them corresponds to some encoding of the class of all permutations. For $R \in \{=, \leq, \geq\}$ and any permutation $\sigma$, we will define a tournament $\mathcal{F}_R(\sigma)$. The class $\mathcal{F}_R$ is the hereditary closure of all $\mathcal{F}_R(\sigma)$.

Let $R \in \{=, \leq, \geq\}$, and let $\sigma \in \mathfrak{S}_n$ be a permutation on $n$ elements. The tournament $\mathcal{F}_R(\sigma)$ consists of $2n$ vertices, called $x_1, \dots, x_n, y_1, \dots, y_n$. Let $X = \{x_1, \dots, x_n\}$ and $Y = \{y_1, \dots, y_n\}$. Each of $X, Y$ is a chain under the natural order, i.e. there is an edge from $x_i$ to $x_j$, resp. from $y_i$ to $y_j$, if and only if $i < j$. The edges between $X$ and $Y$ encode $\sigma$ in a way specified by the relation $R$: there is an edge oriented from $x_i$ to $y_j$ if and only if $iR\sigma^{-1}(j)$. See Figure 1 for an example.

Thus in $\mathcal{F}_=(\sigma)$ the edges oriented from $X$ to $Y$ form a matching which encodes $\sigma$. In $\mathcal{F}_\leq(\sigma)$ and $\mathcal{F}_\geq(\sigma)$, these edges form a half-graph which orders $X$ and $Y$ by inclusion of neighbourhoods, so that the order on $X$ is the natural one, and the order on $Y$ encodes $\sigma$. Precisely, in $\mathcal{F}_\geq(\sigma)$, for any $i, j \in [n]$, we have

$$ N^+(x_i) \cap Y \subseteq N^+(x_j) \cap Y \iff i \leq j \\ (1) \quad \text{and} \quad N^+(y_i) \cap X \subseteq N^+(y_j) \cap X \iff \sigma^{-1}(i) \leq \sigma^{-1}(j), $$

while in $\mathcal{F}_\leq(\sigma)$, the direction of inclusions is reversed.

These encodings of permutations are compatible with patterns.

**Lemma 3.1.** If $\tau$ is a pattern of $\sigma$, then $\mathcal{F}_R(\tau)$ is a subtournament of $\mathcal{F}_R(\sigma)$ for each of the relations $R \in \{=, \leq, \geq\}$.
<figure><img src="image_2.png" /><figcaption>FIGURE 1. The three classes of obstructions to twin-width in tournaments. For readability, edges oriented from some $y_j$ to some $x_i$ have been omitted. Each class consists of some encoding of the class of all permutations, represented here with the permutation $\sigma = 31452$.</figcaption></figure>

*Proof.* If $\sigma \in \mathfrak{S}_n$ and $\tau$ is the pattern induced by $X \subset [n]$, then $\mathcal{F}_R(\tau)$ is isomorphic to the subtournament of $\mathcal{F}_R(\sigma)$ induced by the vertices $x_i$ and $y_{\sigma(i)}$ for $i \in X$. $\square$

**Lemma 3.2.** For each $R \in \{=, \leq, \geq\}$, the class $\mathcal{F}_R$ efficiently interprets the class $O\mathfrak{S}$ of permutations represented as bi-orders. Precisely, there is an interpretation $\Phi_R$, and for any permutation $\sigma \in \mathfrak{S}_n$, $n \geq 2$, there is a $\sigma' \in \mathfrak{S}_{n+1}$ computable in polynomial time such that $O_\sigma = \Phi_R(\mathcal{F}_R(\sigma'))$.

*Proof.* We will first show that $\mathcal{F}_R(\sigma)$ transduces $O_\sigma$, and then how to remove the colouring step of the transduction by slightly extending $\sigma$.

Let $X = \{x_1, \dots, x_n\}$ and $Y = \{y_1, \dots, y_n\}$ be as in the definition of $\mathcal{F}_R(\sigma)$. The transduction uses colouring to guess the set $X$. It then defines two total orders on $Y$, which together describe $\sigma$. The first ordering is given by the direction of edges inside $Y$. The second depends on $R$:

* If $R$ is $=$, edges oriented from $X$ to $Y$ are a perfect matching. The direction of edges in $X$, interpreted through this matching, defines the second order on $Y$.

* If $R$ is $\geq$ or $\leq$, the second order is inclusion, respectively inverse inclusion, of in-neighbourhoods intersected with $X$, see (1).

With the knowledge of which subset is $X$, each of these orders is clearly definable with a first-order formula. Finally, the transduction deletes vertices of $X$, leaving only $Y$ and the two orders that encode $\sigma$.

Let us now show how to deterministically define the partition $X, Y$, at the cost of extending $\sigma$ with one fixed value. Here, we assume $n \geq 2$.

* If $R$ is $=$, define $\sigma' \in \mathfrak{S}_{n+1}$ by $\sigma'(n+1) = n+1$ and $\sigma'(i) = \sigma(i)$ for any $i \leq n$. Then, in $\mathcal{F}_=(\sigma')$, the unique vertex with out-degree 1 is $x_{n+1}$. Its out-neighbour is $y_{n+1}$, and we have $X = N^+(y_{n+1}) \cup \{x_{n+1}\}$.
• If $R$ is $\leqslant$, define $\sigma'(n+1) = 1$ and $\sigma'(i) = \sigma(i) + 1$. Then $x_{n+1}$ has out-degree 1, and its out-neighbour is $y_1$. The only other vertex that may have out-degree 1 is $y_{n+1}$, and this happens if and only if $\sigma'(n) = n + 1$. When this is the case, the direction of the edge $x_{n+1} \leftarrow y_{n+1}$ still allows to distinguish $x_{n+1}$. Finally, $y_1$ is the only out-neighbour of $x_{n+1}$, and satisfies $X = N^{-}(y_1)$.

• If $R$ is $\geqslant$, define once again $\sigma'(n+1) = 1$ and $\sigma'(i) = \sigma(i) + 1$. Then $y_1$ is the unique vertex with in-degree 1, and its in-neighbour is $x_{n+1}$, which satisfies $X = N^{-}(x_{n+1}) \cup \{x_{n+1}\}$.

In all three cases, $\mathcal{F}_R(\sigma')$ contains two extra vertices compared to $\mathcal{F}_R(\sigma)$. These extra vertices can be uniquely identified in first-order logic, and can then be used to define $X$. Combined with the previous transduction, this gives an interpretation of $\mathcal{O}_\sigma$ in $\mathcal{F}_R(\sigma')$. $\square$

We can now prove that the classes $\mathcal{F}_R$ are complex.

**Theorem 1.6.** For each $R \in \{=, \leqslant, \geqslant\}$, the class $\mathcal{F}_R$

(1) has unbounded twin-width,

(2) contains at least $\left\lceil \frac{n}{2} \right\rceil - 1)!$ tournaments on $n$ vertices counted up to isomorphism,

(3) contains at least $\left\lceil \frac{n}{2} \right\rceil - 1)! \cdot n!$ tournaments on vertex set $\{1, \dots, n\}$ counted up to equality,

(4) efficiently interprets the class of all graphs,

(5) and has an AW[*]-hard FO model checking problem.

*Proof.* Item 4 is straightforward by Lemmas 2.10 and 3.2, since efficient interpretations can be composed. By Lemma 2.9 and Theorem 2.7, this in turn implies Item 5.

Item 3 implies Item 2 by a simple counting argument: in an isomorphism class, there are at most $n!$ choices of labelling of vertices with $\{1, \dots, n\}$ (less when the graph has automorphism). Furthermore, each of Items 3 and 4 implies Item 1, by Theorem 2.13 and Theorem 2.11 respectively. Thus it only remains to prove Item 3.

By Lemma 3.2, for all $\sigma \in \mathfrak{S}_n$ there is some $\mathcal{F}_R(\sigma')$ on $2n+2$ vertices such that $\Phi_R(\mathcal{F}_R(\sigma')) = \sigma$, where $\Phi_R$ is an interpretation. Since interpretations preserve isomorphism, it follows that there are at least $n!$ non-isomorphic tournaments on $2n+2$ vertices in $\mathcal{F}_R$. Furthermore, using the same arguments as in Lemma 3.2, it is easy to show that these $\mathcal{F}_R(\sigma')$ have no non-trivial automorphism. Thus, there are exactly $(2n+2)!$ distinct labellings of $\mathcal{F}_R(\sigma')$ with $\{1, \dots, 2n+2\}$. In total, this gives $(2n+2)! \cdot n!$ distinct graphs on vertices $\{1, \dots, 2n+2\}$ in $\mathcal{F}_R$, proving Item 3. $\square$

Thus the classes $\mathcal{F}_=$, $\mathcal{F}_{\leqslant}$, $\mathcal{F}_{\geqslant}$ are obstructions to fixed parameter tractability of FO model checking and twin-width. The rest of the paper shows that they are the only obstructions. One may also verify that all three are minimal, i.e. none of them is contained in another.

## 4. BINARY SEARCH TREE ORDERS

This section presents the good order for twin-width in tournaments. It is based on binary search trees (BST), which we define in a tournament $T$ as
<figure><img src="image_3.png" /><figcaption>FIGURE 2. A binary search tree in a tournament. The direction of omitted edges is not constrained.</figcaption></figure>

a rooted ordered binary tree $S$ (meaning that each node has a left and right child, either of which may be missing), whose nodes are the vertices of $T$, and such that for any $x \in S$

• the left child of $x$ (if any) and its descendants are in $N_T^-(x)$, and

• the right child of $x$ (if any) and its descendants are in $N_T^+(x)$,

see Figure 2.

The order associated to $S$, denoted $<_S$, is the left-to-right order (or in-order traversal) placing a node $x$ after its left child and its descendants, but before its right child and its descendants. Such an order is called a **BST order**.

Remark that because $T$ is only a tournament and not an order as in a standard BST, there is no restriction on the direction of edges between the left and right subtrees of $x$. On the other hand, if $x$ is an ancestor of $y$, then there is an edge oriented from $x$ to $y$ if and only if $x <_S y$. Thus we have

*Remark 4.1.* In a tournament $T$, any branch $B$ of a BST $S$ forms a chain which coincides with $<_S$. That is, for $x, y \in B$, the edge in $T$ is oriented from $x$ to $y$ if and only if $x <_S y$.

We will now define *chain quasi-orders*, which are FO definable quasi-orders with which we will approximate BST orders. Let $C$ be a chain in $T$. Its chain quasi-order $\leq_C^+$ is defined as follows. Enumerate the vertices of $C$ as $c_1, \dots, c_k$ so that edges are oriented from $c_i$ to $c_j$ when $i < j$. Define $A_i = \bigcap_{j \leq i} N^+(c_j)$ (where as an edge case $A_0$ contains all vertices), and $B_i = A_{i-1} \cap N^-(c_i)$. In other words, $A_{i-1}$ is partitioned as $A_i \uplus \{c_i\} \uplus B_i$, where $A_i$ and $B_i$ contain the out- and in-neighbours of $c_i$ respectively. Note that $B_1, \dots, B_k$ and $A_k$ are all disjoint from $C$.

Then each of $B_1, \dots, B_k$, $A_k$, and $\{c_1\}, \dots, \{c_k\}$ is an equivalence class of $\leq_C^+$, and the classes are ordered as

$$B_1 \prec_C^+ c_1 \prec_C^+ B_2 \prec_C^+ c_2 \prec_C^+ \dots B_k \prec_C^+ c_k \prec_C^+ A_k,$$

see Figure 3. This can be seen as the left-to-right order of a partial BST consisting only of a single branch $c_1, \dots, c_k$, with $c_1$ as root and $c_k$ as leaf. It is also a coarsening of the lexicographic order: the latter would refine the order inside each class $B_i$ using $c_{i+1}, \dots, c_k$.

The dual quasi-order $\leq_C^-$ is defined in the same way, but reversing the direction of all edges. Thus, we now enumerate $C$ so that edges are from $c_i$ to $c_j$ when $i > j$, while $A_i = \bigcap_{j \leq i} N^-(c_j)$ and $B_i = A_{i-1} \cap N^+(c_i)$. The rest of the definition is the same.
<figure><img src="image_4.png" /><figcaption>FIGURE 3. Example of construction of the quasi-order $\leq_C^+$. The quasi-order is from left to right, and the triangles are equivalence classes. The direction of omitted edges (from $B_i$ to $B_j \cup \{c_j\}$ for $i < j$) is not constrained. For $\leq_C^-$, the direction of all edges would be reversed.</figcaption></figure>

**Lemma 4.2.** There is a transduction $\Phi$ such that for any tournament $T$ and chain quasi-ordering $\leq$, we have $(T, \leq) \in \Phi(T)$.

*Proof.* The transduction $\Phi$ first uses a colouring step to guess a chain $C$, and an orientation $o \in \{+, -\}$. Depending on this non-deterministic choice, it may yield any chain quasi-ordering. The remainder of $\Phi$ is a deterministic interpretation. For simplicity, we will assume that the orientation $o$ is $+$, the case of $-$ being similar.

Having guessed $C$, the ordering $\leq_C^+$ inside $C$ is simply given by the orientation of edges. Enumerate $C$ as $\{c_1 \leq_C^+ \dots \leq_C^+ c_k\}$. Given $x \notin C$, let $i(x) \in \{0, \dots, k\}$ be maximal such that there are edges oriented $c_j \to x$ for all $1 \leq j \leq i(x)$. Then

* for any $x \notin C$, we have $c_1 \dots c_{i(x)} \leq_C^+ x \leq_C^+ c_{i(x)+1}, \dots, c_k$, and

* for $x, y \notin C$, we have $x \leq_C^+ y$ if and only if $i(x) \leq i(y)$.

This characterisation of $\leq_C^+$ can be expressed by a first-order formula. $\square$

The main result of this section allows in a sense to approximate BST orderings with chain quasi-orders:

**Lemma 4.3.** There is a function $f(k) = 2^{O(k)}$ such that for any tournament $T$, BST ordering $<_S$, and family $\mathcal{P}$ of at least $f(k)$ disjoint intervals of $<_S$, one can find a chain quasi-ordering $\leq$ and a subfamily $\mathcal{P}' \subset \mathcal{P}$ of at least $k$ parts such that any parts $X, Y \in \mathcal{P}'$ satisfy $X \prec Y$ or $Y \prec X$.

Furthermore, $\mathcal{P}'$ as well as the chain $C$ and orientation $o \in \{+, -\}$ defining $\leq$ can be computed in linear time.

*Proof.* Let $T$ be a tournament, $S$ a BST of $T$ and $<_S$ the corresponding order. Consider a family $\mathcal{P}$ of at least $f(k)$ disjoint intervals of $<_S$, where $f(k) = 2^{O(k)}$ will be determined later.

We choose a branch $B = b_0, \dots, b_p$ of $S$ by the following process. First $b_0$ is the root of $S$. For each (yet to be determined) $b_i$, let $S_i$ be the subtree of $S$ rooted in $b_i$, and define the weight $w_i$ to be the number of intervals of $\mathcal{P}$ intersected by $S_i$. Then $b_{i+1}$ is chosen to be the child of $b_i$ that maximizes $w_{i+1}$. This choice ensures that

$$ (2) \qquad 2w_{i+1} + 1 \geq w_i. $$

For each $i < p$, let $d_i$ be the child of $b_i$ other than $b_{i+1}$ (sometimes $d_i$ does not exist), and let $D_i$ be the subtree of $S$ rooted at $d_i$ ($D_i$ is empty if $d_i$ does
not exist). Furthermore, let $L, R$ be the sets of vertices that are before, resp. after the leaf $b_p$ in the order $<_S$. For any $0 \le i \le j \le p$, let

$$L_{i,j} := \bigcup_{\substack{i \le l < j \\ b_l \in L}} \{b_l\} \cup D_l, \quad \text{and} \quad R_{i,j} := \bigcup_{\substack{i \le l < j \\ b_l \in R}} \{b_l\} \cup D_l.$$

Roughly speaking, $L_{i,j}$, resp. $R_{i,j}$ consists of subtrees branching out of $B$ on the left, resp. right, between $b_i$ and $b_j$.

**Claim 4.4.** For any $i, j$, the subtree $S_i$ is partitioned into $L_{i,j} <_S S_j <_S R_{i,j}$.

*Proof.* Clearly $L_{i,j}, S_j, R_{i,j}$ partition $S_i$. Furthermore, if $\ell < j$ and $b_\ell \in L$, then $b_\ell <_S S_j$, and in turn $D_\ell <_S b_\ell$. This proves $L_{i,j} <_S S_j$, and symmetrically $S_j <_S R_{i,j}$. ■

**Claim 4.5.** For $0 \le i < j \le p$, if $w_i \ge w_j + 3$, then there is a part $P \in \mathcal{P}$ such that $P \subset L_{i,j}$ or $P \subset R_{i,j}$.

*Proof.* There are at least three parts of $\mathcal{P}$ that intersect $S_i$ but not $S_j$. Since these three parts and $S_i$ are all intervals of $<_S$, one of these parts, say $P$, is contained in $S_i$. Thus $P$ is a subset of $S_i$ but does not intersect $S_j$, which using Claim 4.4 implies that $P \subset L_{i,j}$ or $P \subset R_{i,j}$. ■

Construct a sequence $i_0 < \dots < i_{2k}$ of indices in $\{0, \dots, p\}$ inductively by taking $i_0 = 0$, and choosing $i_{\ell+1}$ minimal such that $w_{i_{\ell+1}} \le w_{i_\ell} - 3$. Using (2) and the minimality of $i_{\ell+1}$, we obtain for all $\ell$ that

$$(3) \qquad 2w_{i_{\ell+1}} + 1 \ge w_{i_{\ell+1}-1} > w_{i_\ell} - 3,$$

$$(4) \qquad \text{hence } 2w_{i_{\ell+1}} + 3 \ge w_{i_\ell}.$$

We can now define $f$ by $f(0) = 1$ and $f(k+1) = 4f(k)+9$. By assumption, $w_0 = |\mathcal{P}| \ge f(k)$, and it follows from (4) that the construction of $i_\ell$ can be carried out up to $i_{2k}$.

Define $L'_\ell = L_{i_{\ell-1},i_\ell}$, and similarly $R'_\ell = R_{i_{\ell-1},i_\ell}$, see Figure 4. By Claim 4.5, for any $\ell \in [2k]$, either $L'_\ell$ or $R'_\ell$ contains a part of $\mathcal{P}$. Thus, either there are at least $k$ distinct $L'_\ell$ containing a part of $\mathcal{P}$, or there are at least $k$ distinct $R'_\ell$ containing a part of $\mathcal{P}$. Without loss of generality, assume that we are in the former case. We will now forget about vertices which are not in $L$.

Define $C = L \cap B$. By Remark 4.1, this is a chain, whose order coincides with $<_S$. Furthermore, at any node $x$ of $C$, the branch $B$ descends on the right side, since $x <_S b_p$. Thus, the order in $C$ also coincides with the ancestor-descendent order of $S$. (Remark here that if we were in $R$ instead of $L$, the order of $C$ would be the inverse of the ancestor-descendant order.) Now, if $C$ is enumerated as $c_0 <_S \dots <_S c_t$, and $C_i$ is the subtree branching out on the left of $c_i$, defined similarly to $D_i$, then the chain quasi-order $\preceq_C^+$ restricted to $L$ is exactly

$$C_0 \prec_C^+ c_0 \prec_C^+ C_1 \prec_C^+ c_1 \prec_C^+ \dots \prec_C^+ c_t$$

where each subtree $C_i$ is an equivalence class. (In $R$, we would instead use $\preceq_C^-$.) From this description, we obtain that any $L_{i,j}$ is an interval of $\preceq_C^+$ restricted to $L$.
<figure><img src="image_5.png" /><figcaption>FIGURE 4. Sketch of the proof of Lemma 4.3. In the up-
per half, the BST *T* with the extracted branch *B*; circled
in blue, the extracted subsequence *b*ᵢ₉; in green arrows, the
chain *C* = *B* ∩ *L* = {*b*₂, *b*₄, *b*₅, *b*₆}. Below the tree, from top
to bottom: the partition in *L*'_ℓ' and *R*'_ℓ'; the initial family (here
partition) *P*, with the parts contained in some *L*'_ℓ' or *R*'_ℓ' high-
lighted; the final family *P*', obtained by selecting a part of *P*
inside each possible *L*'_ℓ'.</figcaption></figure>

For each $L'_{\ell}$, select a part of $\mathcal{P}$ included in $L'_{\ell}$ if any, and define $\mathcal{P}'$ as the
collection of selected parts. Thus $\mathcal{P}' \subset \mathcal{P}$, and we know from the choice of
the family $\{L'_{\ell}\}_{\ell \in [2k]}$ that $|\mathcal{P}'| \ge k$. Furthermore, if $X \neq Y$ are parts of $\mathcal{P}'$,
there are $s \neq t$ such that $X \subseteq L'_s$ and $Y \subseteq L'_t$. Since the $L'_{\ell}$ are disjoint
intervals of $(L, \preceq_C^{+})$, we have either $L'_s \prec_C^{+} L'_t$ or $L'_t \prec_C^{+} L'_s$, hence a fortiori
either $X \prec_C^{+} Y$ or $Y \prec_C^{+} X$. Thus $\mathcal{P}'$ satisfies all desired properties.

Finally, given the BST *S* and the family *P*, it is routine to compute the weights *w*ᵢ of all nodes in *S* by a bottom-up procedure; this only requires to compute the left-most and right-most parts of *P* intersecting each subtree. From this, it is simple to choose in linear time the branch *B*, the indices *i*ᵢ, the better side *L* or *R*, and finally to compute *C* and *P*'. □

5. APPROXIMATING TWIN-WIDTH

In this section, we prove Lemma 1.4: for any tournament *T* and BST order-
ing <, if *T* has small twin-width, then so does the ordered structure (*T*, <).
This implies an FPT approximation of twin-width in tournaments (The-
orem 1.3).

To this end, we show using Theorem 2.6 and Lemma 4.3 that if (T, <) has large twin-width, then T contains a so-called *chain order representation* of a matrix with high grid rank. It is relatively simple to show that these
<figure><img src="image_6.png" /><figcaption>FIGURE 5. Chain representation of the matrix $M$ of the permutation 31452. Vertices of $A$ are ordered bottom to top by a chain order $\preceq_{C_A}^{+}$, and similarly for $B$. Edges oriented from $A$ to $B$ correspond to ‘1’s in $M$. For readability, edges from $B$ to $A$ (corresponding to ‘0’s) are not drawn. The other omitted edges are unconstrained.</figcaption></figure>

chain order representations are obstructions to twin-width. In section 6, we will improve this result by extracting the canonical obstructions $\mathcal{F}_=, \mathcal{F}_{\le}, \mathcal{F}_{\ge}$ from chain order representations.

**5.1. Chain order representation.** Let $M$ be a 0, 1-matrix and $T$ a tournament. A *chain order representation* of $M$ in $T$ consists of two disjoint subsets $A, B$ of vertices and two chain quasi-orders $\preceq^A, \preceq^B$ such that

* restricted to $A$ and $B$ respectively, $\preceq^A$ and $\preceq^B$ are strict orderings,

* and the adjacency matrix of $(A, \preceq^A)$ versus $(B, \preceq^B)$ is $M$.

See Figure 5 for an example. Explicitly, the matrix $M$ has columns $(A, \preceq^A)$, rows $(B, \preceq^B)$, and contains a ‘1’ at position $(a, b)$ for $a \in A$ and $b \in B$ if and only if $a \to b$ is an edge. The subsets $A, B$ should not be confused with the chains $C_A, C_B$ from which the orders $\preceq^A, \preceq^B$ are defined. Note also that only $A$ and $B$ are required to be disjoint; the sets $A, B, C_A, C_B$ may otherwise intersect.

**Lemma 5.1.** Let $\mathcal{T}$ be a class of tournaments containing chain order representations of matrices with rank-k divisions for arbitrarily large k. Then $\mathcal{T}$ has unbounded twin-width.

*Proof.* Consider a chain representation of $M$ in $T$ defined by subsets $A, B$ and chain orders $\preceq^A, \preceq^B$. Construct the ordered structure $(T', <)$ where $T' = T[A \cup B]$ is the subtournament induced by $A$ and $B$, and the ordering $<$ is obtained by combining $\preceq^A$ and $\preceq^B$: $<$ coincides with $\preceq^A$ and $\preceq^B$ inside $A$ and $B$ respectively, and $A < B$. Thus $M$ is contained in the adjacency matrix of $T'$ ordered by $<$. Call $\mathcal{T}'$ the class of all such ordered structures constructed from $T \in \mathcal{T}$. By assumption, structures in $\mathcal{T}'$ have adjacency matrices with arbitrarily high rank divisions, hence by Theorem 2.6 $\mathcal{T}'$ has unbounded twin-width.

Using Lemma 4.2, it is simple to show that there is a fixed first-order transduction $\Phi$ that given a tournament $T$, produces any ordering $<'$ of $T$
obtained by combining two chain orders as previously. It follows that $\mathcal{T}'$ is
obtained by first-order transduction from $\mathcal{T}$. Since $\mathcal{T}'$ has unbounded twin-
width, this implies by Theorem 2.11 that $\mathcal{T}$ has unbounded twin-width. $\square$

**5.2. Self-extraction in high-rank divisions.** The last tool needed to prove Lemma 1.4 is the following self-extraction lemma for high-rank divisions.

**Lemma 5.2.** Let $M$ be a matrix with a rank-(k³) division ($\mathcal{R}, \mathcal{C}$). Then $M$ has a submatrix $M'$ with a rank-k division such that $M'$ contains only one row (resp. column) from each part of $\mathcal{R}$ (resp. $\mathcal{C}$).

Lemma 5.2 will be used as follows: from a high-rank division whose parts are strictly ordered by a chain-quasi order $\leq$ (while allowing elements of the same part to be equivalent under $\leq$), it yields a high-rank division on a subset of elements totally ordered by $\leq$.

We first extract a high-rank matrix of the desired form from a high-rank
division.

**Lemma 5.3.** Let $M$ be a matrix with a rank-k division ($\mathcal{R}, \mathcal{C}$). Then there exists a submatrix $M'$ with rank $k$ containing only one row (resp. column) from each part of $\mathcal{R}$ (resp. $\mathcal{C}$).

*Proof.* Enumerate the blocks $\mathcal{R} = \{R_1, \dots, R_k\}$ and $\mathcal{C} = \{C_1, \dots, C_k\}$ of the division. Assume by induction that we have already extracted one row (resp. column) from each of $R_1, \dots, R_{k-1}$ (resp. $C_1, \dots, C_{k-1}$) to form a submatrix $M_{k-1}$ of rank $k-1$. Now add all rows of $R_k$ and all columns of $C_k$ to $M_{k-1}$. The resulting matrix has rank at least $k$ since it contains $R_k \times C_k$. Using basis exchange, all but one row of $R_k$ can be removed while preserving rank $k$, and similarly all but one column of $C_k$ can be removed, yielding the desired submatrix. $\square$

*Proof of Lemma 5.2.* Let us enumerate the blocks of the division $(\mathcal{R}, \mathcal{C})$ as $\mathcal{R} = \{R_0 < \dots < R_{k^3-1}\}$ and $\mathcal{C} = \{C_0 < \dots < C_{k^3-1}\}$. We will use two levels of coarser partitions, regrouping blocks $k$ by $k$: define the partition $\mathcal{R}'$ with parts $R'_i = R_{ki} \cup \dots \cup R_{k(i+1)-1}$ for $i < k^2$, as well as $\mathcal{R}''$ with parts $R''_i = R'_{ki} \cup \dots \cup R'_{k(i+1)-1}$ for $i < k$, and similarly $\mathcal{C}'$ and $\mathcal{C}''$. Thus $(\mathcal{R}', \mathcal{C}')$ is a $k^2$-division of $M$, while $(\mathcal{R}'', \mathcal{C}'')$ is a $k$-division.

Now for each $i, j \in [k]$, we consider the submatrix $R'_{ki+j} \times C'_{kj+i}$. Remark that these submatrices all have disjoint sets of rows and columns. Further, $R'_{ki+j} \times C'_{kj+i}$ contains $k$ parts of $\mathcal{R}$ and of $\mathcal{C}$, hence Lemma 5.3 can be applied to extract a rank-k submatrix $M_{i,j}$ using only one row or column from the relevant blocks of $\mathcal{R}$ and $\mathcal{C}$. Define $M'$ to be the submatrix formed only by the rows and columns used in some $M_{i,j}$. The former construction ensures this is only one row or column from each part of $\mathcal{R}$ and $\mathcal{C}$. In $M'$, $(\mathcal{R}'', \mathcal{C}'')$ is a $k$-division whose cell $R''_i \times C''_j$ contains the rank $k$ submatrix $M_{i,j}$. Therefore $M'$ has a rank-k division. $\square$

**5.3. Finding high grid rank representations.** We are now ready to prove that BST orders yield an approximation of twin-width in tournaments. Given a class $\mathcal{T}$ of tournaments, denote by $\mathcal{T}^{\text{BST}}$ the class of ordered tournaments $(T, <_S)$ with $T \in \mathcal{T}$ and $<_S$ some BST ordering of $T$.
**Lemma 5.4.** Let $\mathcal{T}$ be a class of tournaments. If $\mathcal{T}^{\text{BST}}$ has unbounded twin-width, then $\mathcal{T}$ contains chain order representations of matrices with rank-k divisions for arbitrarily large k.

*Proof.* Assume that $\mathcal{T}^{\text{BST}}$ has unbounded twin-width. Since it is a class of ordered structures, we can apply the results of [9] to obtain matrices with large grid rank:

*Claim 5.5.* For any $k$, there exists $(T, <) \in \mathcal{T}^{\text{BST}}$ and intervals of vertices $A_1 < \dots < A_k < B_1 < \dots < B_k$ such that for any $i, j$, the adjacency matrix of $A_i$ versus $B_j$ has rank $k$.

*Proof.* By Theorem 2.6, ordered structures with sufficiently large twin-width have rank-k divisions in their adjacency matrix, for any given $k$. For $\mathcal{T}^{\text{BST}}$ which has unbounded twin-width, this yields $(T, <) \in \mathcal{T}^{\text{BST}}$ and a rank-(2k) division consisting of two partitions $A_1 < \dots < A_{2k}$ and $B_1 < \dots < B_{2k}$ of $V(T)$ such that the adjacency matrix of $A_i$ versus $B_j$ has rank $k$.

Let us ensure that the $A_i$s and $B_j$s are disjoint. If the last element of $A_k$ is smaller than the first of $B_{k+1}$, then $A_1 < \dots < A_k < B_{k+1} < \dots < B_{2k}$ satisfy the desired property. Otherwise, the last element of $B_k$ is smaller than the first of $A_{k+1}$, and symmetrically $B_1 < \dots < B_k < A_{k+1} < \dots < A_{2k}$ are as desired. $\blacksquare$

We now wish to replace the BST ordering $<$ of Claim 5.5 with chain quasi-orders.

*Claim 5.6.* For any $k$, there exists $T \in \mathcal{T}$, two chain quasi-orders $\preceq^A, \preceq^B$ in $T$, and subsets $A_1 \preceq^A \dots \preceq^A A_k$ and $B_1 \preceq^B \dots \preceq^B B_k$ of $V(T)$ with all $A_i$s and $B_j$s pairwise disjoint, such that the adjacency matrix of $A_i$ versus $B_j$ has rank $k$.

*Proof.* Applying Claim 5.5 with $f(k)$ where $f$ is the function of Lemma 4.3, there exists $T \in \mathcal{T}$ and intervals $A_1 < \dots < A_{f(k)} < B_1 < \dots < B_{f(k)}$ of some BST order $<$ such that the adjacency matrix of $A_i$ versus $B_j$ has rank $k$. Applying Lemma 4.3 to the $A_i$s and to the $B_j$s separately yields subfamilies of size at least $k$, both of which are strictly ordered by some chain quasi-order. $\blacksquare$

To obtain the chain order representation from Claim 5.6, we only need to ensure that $\preceq^A, \preceq^B$ are also strict orderings inside each part $A_i$ or $B_j$. This is obtained thanks to Lemma 5.2.

Apply Claim 5.6 with $k^3$, yielding parts $A_i, B_j$ ordered by $\preceq^A, \preceq^B$. Consider the adjacency matrix $M$ of $\bigcup_i A_i$ against $\bigcup_j B_j$ ordered by $\preceq^A$ and $\preceq^B$ respectively, breaking equivalences in the quasi-orderings arbitrarily. Since the matrix of $A_i$ against $B_j$ has rank at least $k^3$, $M$ has a rank-(k^3) division. We then apply Lemma 5.2 to extract $A, B$ with only one element in each $A_i, B_j$, so that the restriction to $A, B$ has a rank-k division. Then the chain quasi-orderings $\preceq_A, \preceq_B$ strictly order $A$ and $B$. Thus $A, B$ define a chain order representation of a matrix with a rank-k division, as desired. $\square$

From Lemmas 5.1 and 5.4, we immediately obtain that if $\mathcal{T}^{\text{BST}}$ has unbounded twin-width, then so does $\mathcal{T}$, or equivalently:
**Lemma 1.4.** There is a function $f$ such that for any tournament $T$ and any BST order $<$,

$$ \mathrm{tww}(T, <) \le f(\mathrm{tww}(T)). $$

Using Lemma 1.4, we obtain an FPT approximation algorithm for twin-width of tournaments.

**Theorem 1.3.** There are functions $f, g: \mathbb{N} \to \mathbb{N}$ and an algorithm that given a tournament $T$ with twin-width $k$, produces a witness that the twin-width of $T$ is at most $f(k)$ in FPT time $g(k) \cdot |T|^{O(1)}$.

*Proof.* Given a tournament $T$, construct an arbitrary BST ordering $<$. By Lemma 1.4, $\mathrm{tww}(T, <)$ is bounded by some function of $\mathrm{tww}(T)$. We then apply to the ordered structure $(T, <)$ the approximation algorithm of ordered structures Theorem 2.6, which is FPT. It finds a contraction sequence for $(T, <)$ of width bounded by a function of $\mathrm{tww}(T, <)$, hence by a function of $\mathrm{tww}(T)$. The same contraction sequence is also valid for $T$, and forgetting the ordering $<$ does not increase its width. $\square$

## 6. EXTRACTING FORBIDDEN TOURNAMENTS

The goal of this section, the last part of the proof of our main result, is to show that any class of tournaments with unbounded twin-width contains one of the classes of obstructions described in section 3.

Recall that $\mathcal{T}^{\mathrm{BST}}$ denotes the class of ordered tournaments $(T, <_S)$ where $T \in \mathcal{T}$ and $<_S$ is some BST ordering of $T$. The precise statement proved in this section is the following.

**Theorem 6.1 (Theorem 1.5 restated).** Let $\mathcal{T}$ be a hereditary class of tournaments. If $\mathcal{T}^{\mathrm{BST}}$ has unbounded twin-width, then $\mathcal{T}$ contains one of the classes $\mathcal{F}_=, \mathcal{F}_{\le}, \mathcal{F}_{\ge}$.

Since the classes $\mathcal{F}_=, \mathcal{F}_{\le}, \mathcal{F}_{\ge}$ have unbounded twin-width, this strengthens Lemma 1.4. The proof builds upon that of Lemma 5.4 in the previous section. The latter constructed chain order representations of matrices with high-rank divisions. From these, we will extract encodings of arbitrary permutations thanks to a major technical result of [9], and further refine these encodings to obtain the classes $\mathcal{F}_=, \mathcal{F}_{\le}, \mathcal{F}_{\ge}$ using Ramsey arguments.

**6.1. Encoding permutations in matrices.** Let us describe the encodings of permutations in matrices used as obstructions to twin-width in [9]. They define six classes of matrices $\mathcal{M}_=, \mathcal{M}_\ne, \mathcal{M}_{\le R}, \mathcal{M}_{\ge R}, \mathcal{M}_{\le C}, \mathcal{M}_{\ge C}$.<fnref n="2" /> Like the classes of tournaments described in section 3, each class $\mathcal{M}_s$ consists of the hereditary closure of encodings $\mathcal{M}_s(\sigma)$ of arbitrary permutations $\sigma$. For a permutation $\sigma$ on $n$ elements, the $n \times n$ matrix $\mathcal{M}_s(\sigma)$ is defined as follows,

<footnote n="2">²The classes are called $\mathcal{F}_=, \mathcal{F}_{\le}, \mathcal{F}_{\ge}$, etc. in [9], we use $\mathcal{M}_=^\sigma$ to avoid ambiguity with the tournaments classes defined in section 3.</footnote>
where $m_{i,j}$ denotes the entry at position $(i, j)$:

<table><tr><td>$\mathcal{M}_{=} (\sigma):$</td><td>$m_{i,j} = 1 \iff j = \sigma(i)$</td></tr><tr><td>$\mathcal{M}_{\neq} (\sigma):$</td><td>$m_{i,j} = 1 \iff j \neq \sigma(i)$</td></tr><tr><td>$\mathcal{M}_{\leq R} (\sigma):$</td><td>$m_{i,j} = 1 \iff j \leq \sigma(i)$</td></tr><tr><td>$\mathcal{M}_{\geq R} (\sigma):$</td><td>$m_{i,j} = 1 \iff j \geq \sigma(i)$</td></tr><tr><td>$\mathcal{M}_{\leq C} (\sigma):$</td><td>$m_{i,j} = 1 \iff i \leq \sigma^{-1}(j)$</td></tr><tr><td>$\mathcal{M}_{\geq C} (\sigma):$</td><td>$m_{i,j} = 1 \iff i \geq \sigma^{-1}(j)$</td></tr></table>

Thus $\mathcal{M}_{=} (\sigma)$ is the usual permutation matrix, $\mathcal{M}_{\neq} (\sigma)$ is its complement, and $\mathcal{M}_{\leq R}$, $\mathcal{M}_{\geq R}$, $\mathcal{M}_{\leq C}$, $\mathcal{M}_{\geq C}$ are obtained from the permutation matrix by propagating the '1's down, up, left, and right respectively, see Figure 6. Observe that if $\tau$ is a pattern of $\sigma$, then $\mathcal{M}_s(\tau)$ is a submatrix of $\mathcal{M}_s(\sigma)$ for each of these encodings $s$.

<figure><img src="image_7.png" /><figcaption>FIGURE 6. The six encodings $=, \neq, \leq R, \geq R, \leq C, \geq C$ (left to right) of the 3-grid permutation 369258147. The 1 and 0 are drawn as black and white squares respectively. (Figure from [9].)</figcaption></figure>

We denote by $\mathcal{E} = \{=, \neq, \leq R, \geq R, \leq C, \geq C\}$ the symbols denoting these six encodings. Thus, for $s \in \mathcal{E}$, $\mathcal{M}_s$ is one of the previously described classes of matrices. The main technical result of [9] is the following.

**Theorem 6.2** ([9, Theorem 29]). There is a function $f$ such that in any matrix $M$ with a rank-$f(k)$ division, there is an encoding $s \in \mathcal{E}$ such that $\mathcal{M}_s(\sigma)$ is a submatrix of $M$ for any permutation $\sigma$ on $k$ elements.

Consider now a class $\mathcal{T}$ such that $\mathcal{T}^{BST}$ has unbounded twin-width. By Lemma 5.4, $\mathcal{T}$ contains chain order representations of matrices with arbitrarily high rank divisions. Applying Theorem 6.2 to these matrices, we obtain the following.

**Proposition 6.3.** For any permutation $\sigma$, there exists an encoding $s \in \mathcal{E}$ such that some $T \in \mathcal{T}$ contains a chain order representation of $\mathcal{M}_s(\sigma)$.

**6.2. Permutations between chains.** Proposition 6.3 proves that there are chain order representations of arbitrary permutations. Such a representation involves four sets of vertices: the disjoint subsets $A, B$ inducing $\mathcal{M}_s(\sigma)$ as adjacency matrix, and the two chains from which the orderings of $A$ and $B$ are defined. The next result shows that only two of those four sets are needed to encode the permutations.

**Proposition 6.4.** For any permutation $\sigma \in \mathfrak{S}_n$, there exists in some $T \in \mathcal{T}$ one of the following two structures:
(1) Either two disjoint ordered subsets $A = \{a_1 <_A \cdots <_A a_n\}$, and $B = \{b_1 <_B \cdots <_B b_n\}$ of vertices such that

* A is a chain corresponding to the order $<_A$ up to reversal, meaning that either for all $i < j$ there is an edge $a_i \to a_j$, or for all $i < j$ there is an edge $a_i \leftarrow a_j$,

* similarly B is a chain corresponding to $<_B$ up to reversal, and

* the adjacency matrix of $(A, <_A)$ versus $(B, <_B)$ is $M_s(\sigma)$ for some encoding $s \in \mathcal{E}$.

(2) Or a subset $A = \{a_1 <_A \cdots <_A a_n\}$ and a chain quasi-order $\prec$ such that

* $\prec$ strictly orders A,

* A is a chain corresponding to $<_A$ up to reversal, and

* the bi-order $(A, <, <_A)$ is isomorphic to either $O_\sigma$ or $O_{\sigma-1}$.

*Proof.* Let $\tau$ be a permutation, which will be chosen as a function of $\sigma$ so as to apply Lemma 2.4. By Proposition 6.3, there exists a chain order representation of $\tau$, consisting of disjoint subsets $A, B$ ordered by $\leq_1, \leq_2$ respectively, such that the adjacency matrix of $A$ versus $B$ for these orders is $M_s(\tau)$ for some encoding $s \in \mathcal{E}$. Enumerate $A = \{a_1 \leq_1 \dots \leq_1 a_n\}$ and $B = \{b_1 \leq_2 \dots \leq_2 b_n\}$.

Consider the bijection $\phi : A \to B$ defined as $\phi(a_i) = b_{\tau(i)}$, which is in a sense represented by $M_s(\tau)$. Through this bijection, we can transfer the orderings $\leq_1$ to $B$ and $\leq_2$ to $A$. That is, we define the ordering $\leq'_2$ of $A$ and $\leq'_1$ of $B$ by

$$ a_i \prec_2 a_j \iff \phi(a_i) \leq_2 \phi(a_j) \iff \tau(i) < \tau(j) $$

$$ \text{and} \quad b_i \prec_1 b_j \iff \phi^{-1}(b_i) \leq_1 \phi^{-1}(b_j) \iff \tau^{-1}(i) < \tau^{-1}(j). $$

Recall that the biorder $O_\tau = ([n], <, <_\tau)$ consists of the natural ordering $<$, and the permutated ordering defined by $i <_\tau j$ if and only if $\tau(i) < \tau(j)$. Observe that $O_\tau$ is isomorphic to both $(A, \leq_1, \leq'_2)$ and $(B, \leq'_1, \leq_2)$, through the maps $i \mapsto a_i$ and $i \mapsto b_{\tau(i)}$ respectively. On this structure, we define a colouring $\lambda : [n]^2 \to \{0,1\}^2$ that combines the adjacency matrices of $T[A]$ and $T[B]$, that is

$$ \lambda(i,j) := (a,b) \quad \text{where} \quad \begin{cases} a = 1 & \iff a_i \to a_j \text{ is an edge} \\ b = 1 & \iff b_{\tau(i)} \to b_{\tau(j)} \text{ is an edge} \end{cases} $$

We now suppose that $\tau$ was chosen so that Lemma 2.4 can be applied to obtain a subset $Q \subset [n]$ such that $O_\tau[Q]$ is isomorphic to $O_\sigma$, and the colouring $\lambda$ restricted to $Q \times Q$ depends only on the orderings $<, <_\tau$.

Consider $A' := \{a_i | i \in Q\}$ and $B' := \{b_{\tau(i)} | i \in Q\}$ be the corresponding subsets of $A, B$. They form a chain representation of $M_s(\sigma)$. Furthermore, the direction of edges in $T[A']$, respectively $T[B']$, depends only on the orderings $\leq_1, \leq'_2$, respectively $\leq'_1, \leq_2$. By Lemma 2.5, this means that $T[A']$ is a transitive tournament whose order corresponds to—in the sense of equal to or inverse of—either $\leq_1$ or $\leq'_2$, and similarly in $B'$. We now have to consider two cases.

(1) If the edges in $T[A']$ correspond to the ordering $\leq_1$, and the edges in $T[B']$ correspond to the order $\leq_2$, then the chain orders become
redundant: we have obtained $M_s(\sigma)$ as adjacency matrix between
two chains, up to some reversal of orderings. This is case 1 of the
statement.

(2) Otherwise, if for instance the edges in $T[A']$ correspond to the order $\leq'_2$, then $A'$ is equipped with the orderings $\leq_1$ (as chain ordering) and $\leq'_2$ (from the direction of edges), which together encode $\sigma$ as a bi-order. This is case 2 of the statement.

The situation is similar when the edges of $T[B']$ correspond to $\leq'_1$, except the roles of the chain ordering and the ordering induced by edges are swapped, which corresponds to replacing $\sigma$ by its inverse. □

**6.3. Merging the two cases.** Next, we reduce case 2 of Proposition 6.4 to case 1 by using Theorem 6.2 a second time. To this end, we need to obtain high rank divisions from chain quasi-orderings.

**Lemma 6.5.** In a tournament $T$, consider a chain quasi-ordering $\prec$ defined by a chain $C$, and an ordered subset of vertices $(X, <_X)$ disjoint from $C$ such that $\prec$ is a total ordering on $X$, and the biorder $(X, <, <_X)$ describes a permutation with a $(k^2+k+1)$-grid. Then the adjacency matrix of $(C, <)$ versus $(X, <_X)$ has a rank-k division.

*Proof.* Consider the chain $C$ and orientation $o$ that define the chain ordering $<$, i.e. $<$ is $\prec_o^o$. We assume that the orientation $o$ is $+$, the proof is similar in the case of $-$. Call $\sigma$ the permutation described by the biorder $(X, <, <_X)$, and enumerate $X$ as $\{x_1 <_X \cdots <_X x_n\}$, so that $x_{\sigma(i)} < x_{\sigma(j)}$ for all $i < j$.

Given $x \notin C$, define $\phi(x) \in C$ as the smallest $c \in C$ with regards to $<$ such that $x \to c$ is an edge, when such a $c$ exists ($\phi(x)$ remains undefined otherwise). By definition of chain quasi-orderings, for $x, y \notin C$, we have $x < y$ if and only if either $\phi(x) < \phi(y)$, or $\phi(x)$ is defined and $\phi(y)$ is not. Thus, denoting $c_i := \phi(x_{\sigma(i)})$, to ensure $x_{\sigma(i)} < x_{\sigma(j)}$, it must be that either $c_i < c_j$ or $c_i$ is defined and $c_j$ is not. In particular, $c_i$ is well defined for all $i < n$ and $c_i < c_j$ for $i < j < n$. The choice of $c_i$ then gives edges $c_i \leftarrow x_{\sigma(i)}$ and $c_j \rightarrow x_{\sigma(i)}$ for all $i < j < n$. Since $c_n$ is not necessarily defined (in fact $|C| = n-1$ is possible), we discard $x_{\sigma(n)}$.

By Lemma 2.2, restricting $\sigma$ to $[n-1]$ decreases the size of its grid by at most 1, leaving a grid of size $(k^2+k)$. It consists of two partitions $A_1 < \cdots < A_{k(k+1)}$ and $B_1 < \cdots < B_{k(k+1)}$ of $[n-1]$ into intervals, such that $\sigma(A_i)$ intersects $B_j$ for all $i, j$. Define $C_i := \{c_\ell \mid \ell \in A_i\}$ and $X_i := \{x_\ell \mid \ell \in B_i\}$ the corresponding subsets of $C, X$. We group them $k+1$ by $k+1$ as $C'_s := \bigcup_{i=(k+1)(s-1)+1}^{(k+1)s} C_i$ and similarly for $X'_t$. To conclude, we only need to prove that the adjacency matrix of $C'_s$ versus $X'_t$ has rank at least $k$ for all $s, t \in [k]$.

For each $i \in [k+1]$, there is by assumption some $\ell_i \in A_{(k+1)(s-1)+i}$ such that $\sigma(\ell) \in B_{(k+1)(t-1)+i}$. Thus $c_{\ell_i}$ is in $C'_s$, and $x_{\sigma(\ell_i)}$ is in $X'_t$ for all $i \in [k+1]$. Also, by choice of $c_i$, there are edges $c_{\ell_i} \leftarrow x_{\sigma(\ell_i)}$, and $c_{\ell_j} \rightarrow x_{\sigma(\ell_j)}$ whenever $\ell_j < \ell_i$. Thus, up to permutation of rows and columns, the matrix of $c_{\ell_1}, \dots, c_{\ell_{k+1}}$ versus $x_{\sigma(\ell_1)}, \dots, x_{\sigma(\ell_{k+1})}$ consists of a diagonal
of 0, and a lower triangle filled with 1. Since this is a $k+1$ by $k+1$ matrix,
this ensures that it has rank at least $k$. $\square$

We can now eliminate the second case of Proposition 6.4.

**Proposition 6.6.** For any permutation $\sigma \in \mathfrak{S}_n$, there exists some $T \in \mathcal{T}$ with two disjoint ordered sets $(A, <_A)$ and $(B, <_B)$, such that the direction of edges inside $A, B$ corresponds to $>_A, <_B$ possibly up to reversal, and the adjacency matrix of $(A, <_A)$ versus $(B, <_B)$ is $M_s(\sigma)$ for some encoding $s \in \mathcal{E}$.

*Proof.* Given the desired permutation $\sigma$ of size $k$, consider $t := f(k)$ given by Theorem 6.2 ensuring some $M_s(\sigma)$ inside any rank-$t$ division. Define then $g(k) = 2(t^2 + t + 1)$, and consider any permutation $\tau$ with a $g(k)$-grid. Note in particular that $\sigma$ is a pattern of $\tau$. We apply Proposition 6.4 to $\tau$, yielding one of two possible encoding of $\tau$. In case 1 of Proposition 6.4, we obtain exactly the desired structure only for $\tau$ instead of $\sigma$. Since $\sigma$ is a pattern of $\tau$, one can extract from it the same structure for $\sigma$ instead. We may thus assume that case 2 of Proposition 6.4 holds. That is, there is an ordered set $(X, <_X)$ and a chain quasi-order $\prec$ which totally orders $X$, and such that $(X, \prec, <_X)$ is the biorder representing $\tau$ or $\tau^{-1}$.

Consider the chain $C$ defining the chain quasi-order $\prec$. By definition, the
order $\prec$ inside $C$ coincides with the direction of edges up to reversal. Also,
by assumption, the order $<_X$ inside $X$ coincides with edges up to reversal.
Thus in $C \cap X$, the orderings $\prec$ and $<_X$ are either equal or opposite of each
other. Defining $X' := X \setminus C$, Lemma 2.3 gives that the restricted permutation
$(X', \prec, <_X)$ still contains a grid half as large as that of $(X, \prec, <_X)$, i.e. of
size at least $(t^2 + t + 1)$.

We now apply Lemma 6.5 to $(C, \prec)$ and $(X', <_X)$ to obtain a rank-$t$ divi-
sion in their adjacency matrix. Then, Theorem 6.2 yields a copy of $M_s(\sigma)$
in the same adjacency matrix for some encoding $s \in \mathcal{E}$, as desired. $\square$

**6.4. Canonical obstructions.** In this section, we finally extract the ob-
structions of section 3 from the structure described by Proposition 6.6. Here,
rather than directly trying to obtain a specific permutation $\sigma$, we fix some
$k \in \mathbb{N}$ and look for any permutation $\sigma$ containing a $k$-grid.

**Proposition 6.7.** Consider a tournament $T$ with disjoint ordered sets of vertices $(A, <_A)$ and $(B, <_B)$, such that the direction of edges inside $A, B$ corresponds to $>_A, <_B$ possibly up to reversal, and the adjacency matrix of $(A, <_A)$ versus $(B, <_B)$ is $M_s(\sigma)$ for some encoding $s \in \mathcal{E}$ and permutation $\sigma$ with a $(k+1)$-grid. Then $T$ contains as subtournament $\mathcal{F}_{s'}(\sigma')$ for some $s' \in \{=, \leq, \geq\}$ and some permutation $\sigma'$ with a $k$-grid.

*Proof.* Firstly, we can assume that the direction of edges inside $A$ corre-
ponds to the ordering $<_A$ without reversal. Indeed, in the adjacency matrix
between $A$ and $B$, reversing the ordering $<_A$ (i.e. the ordering of columns) is
equivalent to (1) pre-composing the permutation $\sigma$ with $i \mapsto n-i+1$ (pre-
serving the $(k+1)$-grid by Lemma 2.1), and (2) exchanging encodings $\leq_C$
and $\geq_C$ (the other encodings are unaffected). Thus reversing $<_A$ preserves
the assumptions on the statement. A similar reasoning holds for $<_B$, and
we may thus assume that the direction of edges in A, B exactly matches with <A and <B.

Next, we can assume that $s$ is one of $=, \le_C, \ge_C$. If this is not the case, we swap the roles of A and B. This corresponds to transposing the adjacency matrix (since A represented columns before and rows after), and complementing it, i.e. swapping ‘0’ for ‘1’ and vice versa (since a ‘1’ used to represent an edge from A to B, and now the opposite). If the matrix was $M_=(\sigma)$ before, this yields $M_=(\sigma^{-1})$, and by Lemma 2.1, $\sigma^{-1}$ still has a $(k+1)$-grid.

If the matrix was $M_{\le R}(\sigma)$, the situation is slightly more complex: transposing and complementing yields $M_{>C}(\sigma^{-1})$, meaning the matrix defined as $M_{\ge C}(\sigma^{-1})$ except for entries $(i, \sigma^{-1}(i))$ that are ‘0’ instead of ‘1’.

*Claim 6.8.* For any permutation $\sigma$ of size $n$, there is a pattern $\sigma'$ of $\sigma$ of size $n-1$ such that $M_{\ge C}(\sigma')$ is a submatrix of $M_{>C}(\sigma)$.

*Proof.* Let $\sigma'$ be the pattern of $\sigma$ induced by $\{1, \dots, n-1\}$. Its matrix $M_{\sigma'}$ is obtained from $M_{\sigma}$ by dropping column $n$ and row $\sigma(n)$. To obtain $M_{\ge C}(\sigma')$ from $M_{>C}(\sigma)$, it suffice to remove column 1 and row $\sigma(n)$, both of which contain only ‘0’s. See Figure 7 for an illustration. ■

<figure><img src="image_8.png" /><figcaption>FIGURE 7. Proof of Claim 6.8. Left: the matrix $M_{\ge C}(\sigma)$ for $\sigma = 369258147$. Removing the 9th column and the row with index $\sigma(9) = 7$, marked in red, yields $M_{\ge C}(\sigma')$ where $\sigma' = 36258147$ is a pattern of $\sigma$.</figcaption></figure>

Right: the matrix $M_{>C}(\sigma)$. Removing again row 7 and this time the 1st column, both of which contain only ‘0’s, yields exactly the same submatrix $M_{\ge C}(\sigma')$.

Applying Claim 6.8 to the matrix $M_{>C}(\sigma^{-1})$ yields $M_{\ge C}(\sigma')$ as submatrix, where $\sigma'$ is a pattern of $\sigma^{-1}$ whose size is only one less than that of $\sigma^{-1}$. Then, by Lemma 2.2, $\sigma'$ contains a grid only one smaller than that of $\sigma^{-1}$, i.e. $\sigma'$ has a $k$-grid. Thus the case of $M_{\le R}(\sigma)$ where $\sigma$ has a $(k+1)$-grid, reduces to that of $M_{\ge C}(\sigma')$ where $\sigma'$ has a $k$-grid. The reduction from $\ge R$ to $\le C$ is similar.

Finally, we are in the situation where we have two disjoint chains A, B ordered by the direction of edges (without reversal), and the adjacency matrix between A and B is one of $M_=(\sigma')$, $M_{\le C}(\sigma')$, or $M_{\ge C}(\sigma')$ for some permutation $\sigma'$ with a $k$-grid. This exactly corresponds to the definition of $F_=(\sigma')$, $F_{\le}(\sigma')$, and $F_{\ge}(\sigma')$ respectively. $\square$

Combining Propositions 6.6 and 6.7 gives that for all $k$, there is a permutation $\sigma$ with a $k$-grid and an encoding $s \in \{=, \le, \ge\}$ such that $F_s(\sigma)$
is contained in some tournament $T \in \mathcal{T}$, and thus $\mathcal{F}_s(\sigma) \in \mathcal{T}$ too as $\mathcal{T}$ is hereditary. One of the three encodings $=, \leq, \geq$ must occur for infinitely many values of $k$, i.e. there is some $s \in \{=, \leq, \geq\}$ such that for arbitrary large $k \in \mathbb{N}$, there is a permutation $\sigma$ with a $k$-grid such that $\mathcal{F}_s(\sigma) \in \mathcal{T}$. Any permutation $\tau$ of size $k$ is a pattern of such a $\sigma$, which by Lemma 3.1 gives that $\mathcal{F}_s(\tau)$ is contained in $\mathcal{F}_s(\sigma)$. It follows that $\mathcal{F}_s(\tau) \in \mathcal{T}$ for all permutation $\tau$, that is $\mathcal{F}_s \subseteq \mathcal{T}$, proving Theorem 6.1.

## 7. DENSE ORIENTED GRAPHS AND RELATIONAL STRUCTURES

In this final section, we generalise our main result in two directions: we replace tournaments by oriented graphs with bounded independent sets, and consider relational structures formed from such oriented graphs augmented by arbitrary binary relations.

**7.1. Generalised binary search trees.** We consider oriented graphs $D$ (forbidding digons). The independence number $\alpha(D)$ is the maximum size of an independent set (subset of vertices with no edges between them) in $D$. An oriented graph $D$ is a tournament if and only if $\alpha(D) = 1$. In a sense, oriented graphs whose independence number is bounded by a small constant resemble tournaments; we will generalise our results to them.

We first generalise the notion of BST to arbitrary oriented graphs. A BST on an oriented graph $D$ is a rooted ordered ternary tree $S$ (meaning that each node has a left, centre, and right child, any of which may be missing) satisfying the following condition. For any node $x$ of the tree, let $L_x, C_x, R_x$ denote the left, centre, and right subtrees of $x$. Then

$$L_x \subseteq N^-(x) \quad C_x \cap N(x) = \emptyset \quad L_r \subseteq N^+(x).$$

The left-to-right order $<_S$ corresponding to the tree is the order satisfying for all node $x$

$$L_x <_S x <_S C_x <_S R_x.$$

The choice of placing $C_x$ after and not before $x$ here is arbitrary.

Any branch $B$ of the tree is an acyclic subgraph in which the direction of edges matches $<_S$. However, it is not necessarily a chain. Indeed, if $x \in B$ is such that the branch $B$ descends into the central subtree of $x$, then $x$ is non-adjacent to all its descendants in $B$. Nonetheless, $B$ can be transformed into a chain at a limited cost when $\alpha(D)$ is small: Let $X \subset B$ be the set of all such centre-branching nodes in $B$. Then $X$ is an independent set and thus $|X| \leq \alpha(D)$, while the rest $B \setminus X$ of the branch is a chain.

Next, we generalise chain quasi-orders. For $C$ a chain in $D$ enumerated as $C = \{c_1, \dots, c_k\}$ such that $c_i \to c_j$ iff $i < j$, we define

$$A_i = \bigcap_{j \leq i} N^+(c_i) \quad \text{and} \quad B_i = A_{i-1} \setminus (N^+(c_i) \cup \{c_i\}).$$

In other words, $A_{i-1}$ is partitioned as $A_i \uplus \{c_i\} \uplus B_i$, where $A_i$ contains the out-neighbours of $c_i$, and $B_i$ the in-neighbours and non-neighbours. The chain quasi-order $\leq_C^+$ is then defined by

$$B_1 \prec_C^+ c_1 \prec_C^+ B_2 \prec_C^+ c_2 \prec_C^+ \dots B_k \prec_C^+ c_k \prec_C^+ A_k,$$
with $B_1, \dots, B_k$ and $A_k$ being the equivalence classes. That is, we order a node $x$ according to the smallest $i$ such that $x \notin N^+(c_i)$. The dual quasi-order $\leq_C$ is defined in the same way, but reversing the direction of all edges.

We can now generalise partition extraction (Lemma 4.3) to oriented graphs with bounded $\alpha$.

**Lemma 7.1.** There is a function $f(k, \alpha) = 2^{O(k+\alpha)}$ such that for any oriented graph $D$ with independence number $\alpha$, BST ordering $<_S$ of $D$, and family $\mathcal{P}$ of at least $f(k, \alpha)$ disjoint intervals of $<_S$, one can find a chain quasi-order $\leq_C$ and a subfamily $\mathcal{P}' \subset \mathcal{P}$ such that $|\mathcal{P}'| \geq k$ and such that the parts of $\mathcal{P}'$ are non-overlapping for $\leq_C$.

Furthermore, $\mathcal{P}'$ as well as the chain $C$ and orientation $o \in \{+, -\}$ defining $\leq_C$ can be computed in linear time.

*Sketch of proof.* The proof of Lemma 4.3 can be applied to directed graphs with essentially no modification. The only issue is that it does not yield a chain quasi-order, because the branches of $S$ are not themselves chains. Instead, the quasi-order $\leq_C$ compatible with the resulting partition $\mathcal{P}'$ can be described by the following structure (up to inversion of all edges). There is a sequence $C = \{c_1, \dots, c_k\}$ of vertices. Each $c_i$ has a type: either complete or anti-complete. If $c_i$ is complete, then for all $j > i$ there is an edge $c_i \to c_j$. If $c_i$ is anti-complete, then for all $j > i$ there is no edge between $c_i$ and $c_j$. We then define subsets $A_i$ by induction: $A_0$ is $V(T) \setminus C$, and $A_i$ is defined as $A_{i-1} \cap N^+(c_i)$ when $c_i$ is complete or as $A_{i-1} \setminus N(c_i)$ when $c_i$ is anti-complete. Then $B_i$ is defined as $A_{i-1} \setminus A_i$, and the quasi-order is

$$B_1 \prec_C^+ c_1 \prec_C^+ B_2 \prec_C^+ c_2 \prec_C^+ \dots B_k \prec_C^+ c_k \prec_C^+ A_k.$$

When there are no anti-complete nodes in $C$, this structure is exactly a chain quasi-order.

Remark now that the anti-complete nodes in $C$ induce an independent set. It follows that there are at most $\alpha$ anti-complete nodes. Then, we can simply remove any anti-complete node $c_i$, and remove from $\mathcal{P}'$ any part which intersects $B_i$, at the cost of at most $\alpha$ parts of $\mathcal{P}'$. $\square$

**7.2. Relational structures over tournaments.** Let us now focus on the second generalisation: to a tournament $T = (V, E)$, we add arbitrary binary relations $R_1, \dots, R_\ell \subseteq V^2$, yielding a relational structure $(V, E, R_1, \dots, R_\ell)$. We will show that the tournament $(V, E)$ in such structures is enough to obtain our main results, without any hypothesis on $R_1, \dots, R_\ell$. Remark that when the tournament $(V, E)$ is transitive, this exactly corresponds to the ordered structures considered in [9]. The relations $R_i$ are required to be binary for twin-width to be well-defined. Naturally, $(V, E)$ can also be an oriented graph with bounded independence number instead of a tournament.

Formally, we fix $\Sigma = \{E, R_1, \dots, R_\ell\}$ a binary relational signature with a distinguished relation $E$, and consider $\Sigma$-structures in which $E$ is interpreted as an oriented graph with independence number bounded by some constant $\alpha$.

A chain order representation of the matrix $M$ in a $\Sigma$-structure $S$ consists of the following:
* two disjoint ordered subsets $(A, \preceq^A)$ and $(B, \preceq^B)$, where $\preceq^A, \preceq^B$ are two chain quasi-orderings in $(V, E)$, and

* a relation $R$ among $E, R_1, \dots, R_\ell$ such that the adjacency matrix of $R$ restricted to $(A, \preceq^A)$ versus $(B, \preceq^B)$ is $M$.

If $\sigma$ is a permutation, we define a chain order representation of $\sigma$ in $S$ as being a chain order representation of the matrix $M_s(\sigma)$ in $S$ where $s$ is any of the encodings in $\mathcal{E} = \{=, \ne, \le_R, \ge_R, \le_C, \ge_C\}$, see section 6.1.

Using Lemma 7.1, it is straightforward to generalise Theorem 1.5.

**Theorem 7.2.** Let $S$ be a hereditary class of $\Sigma$-structures in which $E$ is interpreted as oriented graphs with bounded independence number. If there are structures $S \in S$ with BST orders < for which tww$(S, <)$ is arbitrarily large, then $S$ contains chain order representations of all permutations.

*Sketch of proof.* The proof is the same as the first half of Theorem 1.5, up to Proposition 6.3: Given $S = (V, E, R_1, \dots, R_\ell)$ and the BST ordering $<$ such that tww$(S, <)$ is large, Theorem 2.6 (or rather its natural generalisation to ordered binary structures, see Theorem 7 and Lemma 24 in [9]) yields a high-rank division in the adjacency matrix of one of the relations $E, R_1, \dots, R_\ell$, with rows and columns ordered by $<$. Lemma 7.1 and the arguments of section 5 then allow replacing $<$ with chain orderings, yielding a chain order representation of a matrix with a high-rank division. Finally, Theorem 6.2 extracts an encoding $M_s(\sigma)$ for any permutation $\sigma$ of size $k$, with $k$ an unbounded function of tww$(S, <)$. Since the latter can be arbitrarily large in $S$, one obtains chain order representations of all permutations. $\square$

A variant of Lemma 5.1 shows that structures containing chain order representations of all permutations have unbounded twin-width. Following the arguments of section 5, this yields an FPT approximation algorithm for twin-width of such relational structures:

**Theorem 7.3.** There are functions $f, g$ and an algorithm which given a structure $S = (V, E, R_1, \dots, R_\ell)$ with twin-width $t$, where $(V, E)$ is an oriented graph with independence number $\alpha$, computes a contraction sequence of width $f(t, \alpha, \ell)$ in time $g(t, \alpha, \ell) \cdot |V|^O(1)$.

To obtain the full list of equivalent conditions, we additionally need to extract canonical obstructions from chain order representations by generalising the proofs of section 6.

Consider a chain order representation of a permutation $\sigma$ on $n$ elements. It consists of four subsets of vertices: $A, B$ between which the relation $R$ induces the matrix $M_s(\sigma)$, and the chains $C_A, C_B$ which define the appropriate chain orderings $\preceq^A, \preceq^B$. The proof of Proposition 6.4 using Lemma 2.4 applies with minor modifications to reduce to one of two cases:

(1) either the orientation of edges of $E$ in $A, B$ coincides with $\preceq^A, \preceq^B$ respectively up to reversal, and the adjacency matrix of $(A, \preceq^A)$ versus $(B, \preceq^B)$ for the relation $R$ is $M_s(\sigma)$,

(2) or the orientation of edges of $E$ in $A$ defines an ordering $<_A$ such that the border $(A, \preceq_A, <_A)$ represents the permutation $\sigma$, or similarly with $B$.
The only difference with the statement of Proposition 6.4 is that in case 1, the matrix $\mathcal{M}_s(\sigma)$ can be encoded by any of the relations $R \in \Sigma$ instead of just $E$. A subtlety is that since $(V, E)$ is now an oriented graph and not a tournament, applying Lemma 2.4 could also lead to $A$ or $B$ being an independent set instead of a chain. However, since the size of independent sets is restricted, this cannot happen as long as sufficiently large permutations are considered.

Next, the proofs of Lemma 6.5 and Proposition 6.6 can be adapted with minor changes accounting for non-edges, to show that case 2 above reduces to case 1. Thus, for any permutation $\sigma$, we can find in some $S \in \mathcal{S}$ two disjoint chains $(A, <_A)$ and $(B, <_B)$ where $>_A, <_B$ coincides with the orientation of edges of $E$ inside $A, B$ up to reversal, such that the adjacency matrix of some relation $R \in \Sigma$ between $(A, <_A)$ and $(B, <_B)$ is $\mathcal{M}_s(\sigma)$, for some encoding $s \in \mathcal{E}$. Using the same arguments as Proposition 6.7, we can assume that the orientation of edges of $E$ in fact coincides with $>_A, <_B$ without reversal.

To summarise, for any permutation $\sigma$, we obtain the following structure in some $S \in \mathcal{S}$ for some encoding $s \in \mathcal{E}$: disjoint sets $A = \{a_1 <_A \cdots <_A a_n\}$ and $B = \{b_1 <_B \cdots <_B b_n\}$, and edges

(5) $a_i \to a_j$ and $b_i \to b_j$ in $E$ for all $i < j$, and

(6) $a_i b_j \in R$ if and only if there is a 1 at position $(i, j)$ in $\mathcal{M}_s(\sigma)$.

In the case of tournaments, $E = R$ was the only relation in $\Sigma$ and the above entirely specified the tournament induced by $A \cup B$, describing the minimal obstructions from section 3. This is no longer the case: edges of $E$ between $A$ and $B$, of $R$ inside $A$ and $B$, and of all the remaining relations are left unspecified by the previous description. To obtain canonical obstructions, and particularly to obtain an efficient interpretation from $\mathcal{S}$ to the class of all graphs, we need to eliminate these remaining choices. To this end, we will once again use Lemma 2.4.

The setup is similar to the proof of Proposition 6.4. Given a structure as above representing $\tau$, we consider the biorder $\mathcal{O}_{\tau} = ([n], <, <_{\tau})$ and define the colouring $\lambda : [n]^2 \to \Gamma$ where $\lambda(i, j)$ the substructure induced by $a_i, a_j, b_{\tau(i)}, b_{\tau(j)}$. Here, the set $\Gamma$ of colours is the set of all $\Sigma$-structures on four vertices. Given now any desired permutation $\sigma$, consider $\tau$ function of $\sigma$ and $|\Gamma|$ so that Lemma 2.4 gives a subset $X \subset [n]$ such that the substructure $\mathcal{O}_{\tau}[X]$ is isomorphic to $\mathcal{O}_{\sigma}$, and $\lambda$ restricted to $X$ only depends on the orders $<$ and $<_{\tau}$, i.e. there is a function $\eta : \{-1, 0, 1\}^2 \to \Gamma$ such that $\lambda(i, j) = \eta(\mathrm{ot}(i, j), \mathrm{ot}_{\tau}(i, j))$. Restricting to $A' = \{a_i \mid i \in X\}$ and $B' = \{b_{\sigma(i)} \mid i \in X\}$, we obtain an encoding of $\sigma$ in which the substructure induced by $a_i, a_j, b_{\tau(i)}, b_{\tau(j)}$ is entirely specified by $\eta(\mathrm{ot}(i, j), \mathrm{ot}_{\tau}(i, j))$.

Thus, we now have an encoding of any given permutation $\sigma$ which in addition to conditions (5) and (6) above, satisfies

(7) There is a map $\eta : \{-1, 0, 1\}^2 \to \Gamma$ such that the adjacencies of vertices $a_i, a_j, b_{\sigma(i)}, b_{\sigma(j)}$ are as specified by $\eta(\mathrm{ot}(i, j), \mathrm{ot}_{\sigma}(i, j))$.

The choice of $\eta$ and $\sigma$ entirely specifies this structure, which we call $\mathcal{F}_{\eta}(\sigma)$. Some choices of $\eta$ are impossible, as they can either be self contradictory
(there is some redundant information in this encoding), or contradict conditions (5) and (6). Denote by $\mathcal{H} \subset \{-1, 0, 1\} \to \Gamma$ the set of valid choices of $\eta$. Each $\eta \in \mathcal{H}$ yields an encoding $\mathcal{F}_{\eta}(\sigma)$ of any given permutation $\sigma$, and we call $\mathcal{F}_{\eta}$ the hereditary closure of all $\mathcal{F}_{\eta}(\sigma)$.

From Theorem 7.2 and the previous arguments, we obtain the following:

**Lemma 7.4.** Let $S$ be a hereditary class of $\Sigma$-structures in which $E$ is interpreted as an oriented graph with independence number bounded by $\alpha$. If $S$ has unbounded twin-width, then it contains as a subset $\mathcal{F}_{\eta}$ for some $\eta \in \mathcal{H}$.

We finally need to show that $\mathcal{F}_{\eta}$ is an obstruction to the properties we are interested in. Efficiently interpreting all graphs is the most technical step.

**Lemma 7.5.** Each of the classes of obstructions $\mathcal{F}_{\eta}$ for $\eta \in \mathcal{H}$ efficiently interprets the class $O_{\mathcal{G}}$ of all biorders.

*Sketch of proof.* The technique is the same as in the case of tournaments in Lemma 3.2. Consider some encoding $\mathcal{F}_{\eta}(\sigma)$ of an arbitrary permutation $\sigma$, with vertex set $A \uplus B$ as described by conditions (5)–(7). If given a way to distinguish vertices in $A$ from vertices in $B$, then one can order $A$ and $B$ according to the edges of $E$, and read the matrix $M_s(\sigma)$ between them in the relation $R$. It is then simple to reconstruct the biorder $O_{\sigma}$ with a first-order interpretation with the same method as Lemma 3.2 (see [9, Lemma 40]).

The difficulty is thus to distinguish $A$ from $B$. There are several cases to consider depending on the edges of $E$ specified by $\eta$ between $A$ and $B$. In each case, we construct a slightly larger structure $S \in \mathcal{F}_{\eta}$, and show that from $S$, one can interpret $\mathcal{F}_{\eta}(\sigma)$ augmented by unary predicates to distinguish $A$ and $B$.

The rest of this proof focuses on $E$, and not the other relations $R_1, \dots, R_{\ell}$. In a structure $\mathcal{F}_{\eta}(\sigma')$, we enumerate vertices as $A = \{a_1 <_A a_2 <_A \dots \}$ and $B = \{b_1 <_B b_2 <_B \dots \}$ as in the definition of $\mathcal{F}_{\eta}(\sigma')$ above.

*When there are many non-edges.* In $\mathcal{F}_{\eta}(\sigma)$, for all choices of $i, j \in [n]$ satisfying $i < \sigma^{-1}(j)$ and $\sigma(i) < j$, the presence of an edge between $a_i$ and $b_j$ and its direction depend only on $\eta$.

First, let us assume that $a_i b_j$ is a non-edge for all such $i, j$. Then, we embed $\sigma$ in a permutation $\sigma' \in \mathfrak{S}_{n+2}$ by setting $\sigma'(1) = 1$, $\sigma'(n+2) = n+2$, and $\sigma'(i+1) = \sigma(i) + 1$. In $\mathcal{F}_{\eta}(\sigma')$, we have that $a_1 b_j$ is a non-edge for all $j > 1$, and so is $a_i b_{n+2}$ for all $i < n+2$. Also, the non-neighbourhood of any $a_i$ (resp. $b_j$) is contained in $B$ (resp. $A$). Delete now the vertices $a_{n+2}$ and $b_1$. The resulting structure is still in $\mathcal{F}_{\eta}$, as it is a hereditary class. Now $A$ and $B$ are the non-neighbourhoods of $b_{n+2}$ and $a_1$, and are the only pair of non-neighbourhoods which cover the entire vertex set. This uniquely defines $A$ and $B$, and can be expressed in first-order logic. It then suffices to forget $a_1$ and $b_{n+2}$ (the minimum of $A$ and maximum of $B$) to retrieve $\mathcal{F}_{\eta}(\sigma)$ while knowing the bipartition $A, B$.

Observe that the structure described above is entirely determined by $\eta$ and $\sigma$, and is easily computed in polynomial time. Thus we obtain an efficient interpretation of $O_{\mathcal{G}}$ from $\mathcal{F}_{\eta}$.

Similar arguments apply when there are non-edges between $a_i$ and $b_j$ for the other three combinations of inequalities between $i, \sigma^{-1}(j)$, and $\sigma(i), j$:
one only needs to swap the roles of $a_1$ with $a_{n+2}$, and $b_1$ with $b_{n+2}$ as required. We can thus assume that there is an edge in $E$ between $a_i$ and $b_j$ for all $i, j$ except possibly $j = \sigma(i)$.

**When there is an anti-matching.** Assume now that $a_i b_{\sigma(i)}$ is a non-edge for all $i$. Without loss of generality, assume that whenever $i, j$ satisfy $i < \sigma^{-1}(j)$ and $j < \sigma(i)$, then $a_i \to b_j$ is an edge. (in the opposite case, the roles of $A$ and $B$ can be swapped in the following argument). Define now $\sigma' \in \mathfrak{S}_{n+1}$ by $\sigma'(i) = \sigma(i) + 1$ and $\sigma'(n + 1) = 1$. Thus $a_i \to b_1 \to b_i$ are edges for all $i > 1$. Delete now $a_{n+1}$, so that $b_1$ is the unique vertex without a non-neighbour, and the partition $A, B$ is given by the in-neighbourhood and out-neighbourhood of $b_1$. This allows to describe $A, B$ in first-order logic. Once again, the previous structure can be constructed in polynomial time from $\sigma$, hence $\mathcal{F}_{\eta}$ efficiently interprets $\mathcal{O}_{\mathfrak{S}}$.

These two first cases deal with all possible non-edges in $E$ between $A$ and $B$. Thus, we can now assume $E$ to be a tournament, and not just an oriented graph.

**When $E$ is a total order.** Consider now the case where $\eta$ specifies that edges in $E$ are always oriented from $A$ to $B$, or vice versa. Then the relation $E$ is simply a total ordering, making $\mathcal{F}_{\eta}$ a class of ordered structures with unbounded twin-width. In this case, we can invoke the known results on ordered structures to conclude [9, Theorem 42].

**When $E$ has large twin-width.** We are only left with the case where $E$ is a tournament, and the edges between $A$ and $B$ are not all oriented in the same direction. Consider the permutation $\tau = 132$. One can pick $i, j \in \{1, 2, 3\}$ to realise all possible pairs of relative orderings of $i, \tau^{-1}(j)$ on the one hand, and $\tau(i), j$ on the other. Since the direction of edges between $A, B$ only depends on these relative orderings, and both directions must be feasible, it follows that $\mathcal{F}_{\eta}(\tau)$ must contain edges going in both directions between $A$ and $B$.

Now consider a permutation $\sigma \in \mathfrak{S}_n$ with a sufficiently large grid, and consider the substitution of $\tau$ in $\sigma$, that is the permutation $\sigma' \in \mathfrak{S}_{3n}$ defined by

$$ \sigma'(3(i-1)+j) = 3(\sigma(i)-1) + \tau(j). $$

In $\mathcal{F}_{\eta}(\sigma')$, observe that the sets $\{a_{3i+1}, a_{3i+2}, a_{3i+3}\}$ and $\{b_{3j+1}, b_{3j+2}, b_{3j+3}\}$ are non-homogeneous if and only if $j = \sigma(i)$. This implies that the adjacency matrix of $(A, <_A)$ versus $(B, <_B)$ for the relation $E$ contains a high rank division. In other words, the tournament $(A \cup B, E)$ itself has large twin-width, without having to consider the other relations $R_1, \dots, R_\ell$.

Thus we can use the results of section 6 to reduce to the case where in $\mathcal{F}_{\eta}(\sigma)$, the tournament $(A \cup B, E)$ is one of the obstruction $\mathcal{F}_=(\sigma)$, $\mathcal{F}_\leq(\sigma)$, $\mathcal{F}_\geq(\sigma)$ described in section 3. We then conclude using the efficient interpretation from tournament obstructions given by Lemma 3.2. $\square$

The other hardness properties for $\mathcal{F}_{\eta}$ are easily obtained.

**Lemma 7.6.** Each of the classes of obstructions $\mathcal{F}_{\eta}, \eta \in \mathcal{H}$

<footnote>(1) has unbounded twin-width,</footnote>
(2) contains at least $\frac{(n/2)!}{c^n}$ structures on $n$ vertices counted up to isomorphism for some constant $c$,

(3) efficiently interprets the class of all graphs,

(4) and has an AW[*]-hard FO model checking problem.

*Proof.* For each $\mathcal{F}_\eta$ and any permutation $\sigma \in \mathcal{S}_n$, there is a $\mathcal{S} \in \mathcal{F}_\eta$ consisting of two chains $A, B$ of length $n$ each, encoding $\sigma$ as described by conditions (5) and (6). After guessing the two subsets $A, B$ (at most $2^{2n}$ choices), one can deterministically reconstruct $\sigma$. This implies that there are at least $\frac{n!}{4^n}$ non-isomorphic structures on $2n$ vertices in $\mathcal{F}_\eta$, proving (2). It follows by Theorem 2.13 that $\mathcal{F}_\eta$ has unbounded twin-width (1). Finally, the efficient interpretation (3) is provided by Lemmas 2.10 and 7.5, and implies model checking hardness (4) by Lemma 2.9. $\square$

The main result follows from Lemmas 7.4 and 7.6.

**Theorem 7.7.** Let $\mathcal{S}$ be a class of $\Sigma$-structures in which $A$ is interpreted as oriented graphs with independence number at most some constant $k$. Under the assumption $\mathrm{FPT} \neq \mathrm{AW}[*]$, the following are equivalent:

(1) $\mathcal{S}$ has bounded twin-width,

(2) FO model checking in $\mathcal{S}$ is FPT,

(3) FO model checking in $\mathcal{S}$ is not AW[*]-hard,

(4) $\mathcal{S}$ does not interpret the class of all graphs,

(5) $\mathcal{S}$ is monadically NIP,

(6) $\mathcal{S}$ contains at most $c^n$ structures on $n$ vertices for some constant $c$, counted up to isomorphism.

## ACKNOWLEDGEMENTS

The authors are extremely grateful to Édouard Bonnet for stimulating discussions on the topics of this work, and Szymon Toruńczyk for helpful explanation on model theoretic aspects of section 5. We would also like to thank the anonymous reviewers for their very helpful remarks and suggestions.

## REFERENCES

[1] Nir Ailon, Moses Charikar and Alantha Newman. "Aggregating Inconsistent Information: Ranking and Clustering". In: *J. ACM* 55.5 (Nov. 2008). ISSN: 0004-5411. DOI: 10.1145/1411509.1411513.

[2] Noga Alon et al. "Dominating sets in k-majority tournaments". In: *Journal of Combinatorial Theory, Series B* 96.3 (2006), pp. 374–387. ISSN: 0095-8956. DOI: 10.1016/j.jctb.2005.09.003.

[3] Jakub Balabán and Petr Hlinený. "Twin-Width Is Linear in the Poset Width". In: *16th International Symposium on Parameterized and Exact Computation, IPEC 2021, September 8-10, 2021, Lisbon, Portugal*. Ed. by Petr A. Golovach and Meirav Zehavi. Vol. 214. LIPIcs. Schloss Dagstuhl, 2021, 6:1–6:13. DOI: 10.4230/LIPIcs.IPEC.2021.6.

[4] Manuel Bodirsky. "Ramsey classes: examples and constructions." In: *Surveys in combinatorics* 424 (2015), p. 1.

[5] Mikołaj Bojańczyk. personal communication. July 2022.
[6] Édouard Bonnet et al. "Twin-width and permutations". In: *Logical Methods in Computer Science* Volume 20, Issue 3 (July 2024). DOI: 10.46298/lmcs-20(3:4)2024.

[7] Édouard Bonnet et al. "Twin-width I: Tractable FO Model Checking". In: *J. ACM* 69.1 (2022), 3:1–3:46. DOI: 10.1145/3486655.

[8] Édouard Bonnet et al. "Twin-width II: small classes". In: *Combinatorial Theory* 2.2 (2022). ISSN: 2766-1334. DOI: 10.5070/C62257876.

[9] Édouard Bonnet et al. "Twin-Width IV: Ordered Graphs and Matrices". In: *J. ACM* 71.3 (June 2024). ISSN: 0004-5411. DOI: 10.1145/3651151.

[10] Édouard Bonnet et al. *Twin-width VII: groups*. 2022. DOI: 10.48550/ARXIV.2204.12330. arXiv: 2204.12330.

[11] Édouard Bonnet et al. "Twin-Width VIII: Delineation and Win-Wins". In: *17th International Symposium on Parameterized and Exact Computation (IPEC 2022)*. Ed. by Holger Dell and Jesper Nederlof. Vol. 249. LIPIcs. Dagstuhl, Germany: Schloss Dagstuhl, 2022, 9:1–9:18. ISBN: 978-3-95977-260-0. DOI: 10.4230/LIPIcs.IPEC.2022.9.

[12] Youssef Boudabbous and Maurice Pouzet. "The morphology of infinite tournaments; application to the growth of their profile". In: *European Journal of Combinatorics* 31.2 (2010). Combinatorics and Geometry, pp. 461–481. ISSN: 0195-6698. DOI: 10.1016/j.ejc.2009.03.027.

[13] Samuel Braunfeld and Michael C Laskowski. *Existential characterizations of monadic NIP*. 2022. DOI: 10.48550/ARXIV.2209.05120. arXiv: 2209.05120.

[14] Maria Chudnovsky, Alexandra Fradkin and Paul Seymour. "Tournament immersion and cutwidth". In: *Journal of Combinatorial Theory, Series B* 102.1 (2012), pp. 93–101. ISSN: 0095-8956. DOI: 10.1016/j.jctb.2011.05.001.

[15] Rodney G Downey, Michael R Fellows and Udayan Taylor. "The parameterized complexity of relational database queries and an improved characterization of W[1]". In: *DMTCS* 96 (1996), pp. 194–213.

[16] Jan Dreier, Nikolas Mählmann and Szymon Toruńczyk. "Flip-Breakability: A Combinatorial Dichotomy for Monadically Dependent Graph Classes". In: *Proceedings of the 56th Annual ACM Symposium on Theory of Computing*. STOC 2024. Vancouver, BC, Canada: Association for Computing Machinery, 2024, pp. 1550–1560. ISBN: 9798400703836. DOI: 10.1145/3618260.3649739.

[17] Fedor V. Fomin and Michał Pilipczuk. "On width measures and topological problems on semi-complete digraphs". In: *Journal of Combinatorial Theory, Series B* 138 (2019), pp. 78–165. ISSN: 0095-8956. DOI: 10.1016/j.jctb.2019.01.006.

[18] Alexandra Fradkin and Paul Seymour. "Tournament pathwidth and topological containment". In: *Journal of Combinatorial Theory, Series B* 103.3 (2013), pp. 374–384. ISSN: 0095-8956. DOI: 10.1016/j.jctb.2013.03.001.

[19] Jakub Gajarský et al. "A New Perspective on FO Model Checking of Dense Graph Classes". In: *ACM Trans. Comput. Logic* 21.4 (July 2020). ISSN: 1529-3785. DOI: 10.1145/3383206.
[20] Jakub Gajarský et al. "FO model checking on posets of bounded width". In: *2015 IEEE 56th Annual Symposium on Foundations of Computer Science*. IEEE. 2015, pp. 963–974. DOI: 10.1109/FOCS.2015.63.

[21] Ronald L Graham, Bruce L Rothschild and Joel H Spencer. *Ramsey theory*. Vol. 20. John Wiley & Sons, 1991.

[22] Martin Grohe and Daniel Neuen. "Isomorphism for Tournaments of Small Twin Width". In: *51st International Colloquium on Automata, Languages, and Programming (ICALP 2024)*. Ed. by Karl Bringmann et al. Vol. 297. LIPIcs. Dagstuhl, Germany: Schloss Dagstuhl, 2024, 78:1–78:20. ISBN: 978-3-95977-322-5. DOI: 10.4230/LIPIcs.ICALP.2024.78.

[23] Sylvain Guillemot and Dániel Marx. "Finding small patterns in permutations in linear time". In: *Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2014, Portland, Oregon, USA, January 5-7, 2014*. 2014, pp. 82–101. DOI: 10.1137/1.9781611973402.7.

[24] Mithilesh Kumar and Daniel Lokshtanov. "Faster Exact and Parameterized Algorithm for Feedback Vertex Set in Tournaments". In: *33rd Symposium on Theoretical Aspects of Computer Science (STACS 2016)*. Ed. by Nicolas Ollinger and Heribert Vollmer. Vol. 47. LIPIcs. Dagstuhl, Germany: Schloss Dagstuhl, 2016, 49:1–49:13. ISBN: 978-3-95977-001-9. DOI: 10.4230/LIPIcs.STACS.2016.49.

[25] Adam Marcus and Gábor Tardos. "Excluded permutation matrices and the Stanley-Wilf conjecture". In: *J. Comb. Theory, Ser. A* 107.1 (2004), pp. 153–160. DOI: 10.1016/j.jcta.2004.04.002.

[26] Sergey Norin et al. "Proper minor-closed families are small". In: *Journal of Combinatorial Theory, Series B* 96.5 (2006), pp. 754–757. ISSN: 0095-8956. DOI: 10.1016/j.jctb.2006.01.006.

[27] Michał Pilipczuk. "Tournaments and Optimality: New Results in Parameterized Complexity". PhD thesis. University of Bergen, Aug. 2013. URL: https://bora.uib.no/bora-xmlui/bitstream/handle/1956/7650/dr-thesis-2013-Michal-Pilipczuk.pdf.

INSTITUTE FOR BASIC SCIENCE (IBS), DISCRETE MATHEMATICS GROUP, 55 EXPO-RO, YUSEONG-GU, DAEJEON, SOUTH KOREA 34126.

Email address: research@colingeniet.com

LABORATOIRE DE L'INFORMATIQUE DU PARALLÉLISME, ENS DE LYON, 46 ALLÉE D'ITALIE, 69364 LYON CEDEX 07, FRANCE

Email address: stephan.thomasse@ens-lyon.fr