Tree automata and pigeonhole classes of matroids: I

Hlineny's Theorem shows that any sentence in the monadic second-order logic of matroids can be tested in polynomial time, when the input is limited to a class of F-representable matroids with bounded branch-width (where F is a finite field). If each matroid in a class can be decomposed by a subcubic tree in such a way that only a bounded amount of information flows across displayed separations, then the class has bounded decomposition-width. We introduce the pigeonhole property for classes of matroids: if every subclass with bounded branch-width also has bounded decomposition-width, then the class is pigeonhole. An efficiently pigeonhole class has a stronger property, involving an efficiently-computable equivalence relation on subsets of the ground set. We show that Hlineny's Theorem extends to any efficiently pigeonhole class. In a sequel paper, we use these ideas to extend Hlineny's Theorem to the classes of fundamental transversal matroids, lattice path matroids, bicircular matroids, and H-gain-graphic matroids, where H is any finite group. We also give a characterisation of the families of hypergraphs that can be described via tree automata: a family is defined by a tree automaton if and only if it has bounded decomposition-width. Furthermore, we show that if a class of matroids has the pigeonhole property, and can be defined in monadic second-order logic, then any subclass with bounded branch-width has a decidable monadic second-order theory.


Introduction
The model-checking problem involves a class of structures and a logical language capable of expressing statements about those structures. We consider a sentence from the language. The goal is a procedure which will decide whether or not the sentence is satisfied by a given structure from the class. Our starting points are the model-checking meta-theorems due to Courcelle [4] and Hliněný [15]. Courcelle's Theorem proves that there is an efficient model-testing procedure for any sentence in monadic second-order logic, when the input class consists of graphs with bounded structural complexity. Hliněný proves an analogue for matroids representable over finite fields.
Both theorems provide algorithms that are not only polynomial-time, but fixed-parameter tractable (see [7]). This means that the input contains a numerical parameter, λ. The notion of fixed-parameter tractability captures the distinction between running times of order n f (λ) and those of order f (λ)n c , where n is the size of the input, f (λ) is a value depending only on λ, and c is a constant. When we restrict to a fixed value of λ, both running times are polynomial with respect to n, but algorithms of the latter type will typically be feasible for a larger range of λ-values. An algorithm with a running time of O(f (λ)n c ) is said to be fixed-parameter tractable with respect to λ. Theorem 1.1 (Courcelle's Theorem). Let ψ be a sentence in MS 2 . We can test whether graphs satisfy ψ with an algorithm that is fixed-parameter tractable with respect to tree-width.
The monadic second-order logic MS 2 allows us to quantify over variables representing vertices, edges, sets of vertices, and sets of edges. NP-complete properties such as Hamiltonicity and 3-colourability can be expressed in MS 2 . Courcelle's Theorem shows that the extra structure imposed by bounding the tree-width of input graphs transforms these properties from being computationally intractable to tractable. Theorem 1.2 (Hliněný's Theorem). Let ψ be a sentence in CMS 0 and let F be a finite field. We can test whether F-representable matroids satisfy ψ with an algorithm that is fixed-parameter tractable with respect to branch-width.
The counting monadic second-order language CMS 0 is described in Section 3. Our main theorem identifies the structural properties underlying the proof of Hliněný's Theorem. Theorem 1.3. Let M be an efficiently pigeonhole class of matroids. Let ψ be a sentence in CMS 0 . We can test whether matroids in M satisfy ψ with an algorithm that is fixed-parameter tractable with respect to branch-width. Theorem 1.3 is proved by Proposition 6.1 and Theorem 6.5. In a sequel [10], we will prove that we can now extend Hliněný's Theorem to several natural classes of matroids. Fundamental transversal matroids, lattice path matroids, bicircular matroids, and H-gain-graphic matroids with H a finite group: all these classes have fixed-parameter tractable algorithms for CMS 0 model-checking, where the parameter is branch-width.
The pigeonhole property is motivated by matroids representable over finite fields. Let (U, V ) be a separation of order at most λ in M , a simple matroid representable over a finite field, F. We can think of M as a subset of points in the projective space P = PG(r(M ) − 1, F). The subspaces of P spanned by U and V intersect in a subspace, P , with affine dimension at most λ − 2. If X and X are subsets of U , and their spans intersect P in the same subspace, then no subset of V can distinguish them. By this we mean that both X ∪ Z and X ∪ Z are independent or both are dependent, for any subset Z ⊆ V . This induces an equivalence relation on subsets of U . The number of classes under this relation is at most the number of subspaces of PG(λ − 2, F). Now we generalise this idea. Let E be a finite set, and let I be a collection of subsets. If U is a subset of E, then ∼ U is the equivalence relation on subsets of U such that X ∼ U X if no subset of E − U can distinguish between X and X ; that is, for all Z ⊆ E − U , both X ∪ Z and X ∪ Z are in I, or neither of them is. A set-system, (E, I), has decomposition-width at most q if there is a subcubic tree with leaves in bijection with E, such that if U is any set displayed by the tree, then ∼ U has at most q equivalence classes. Since every matroid is a set-system, the decomposition-width of a matroid is a natural specialisation. This notion of decomposition-width is equivalent to that used by Král [18] and by Strozecki [25,26], although our definition is cosmetically quite different. Theorem 1.3 relies on tree automata to check whether monadic sentences are satisfied. (As do the theorems of Courcelle and Hliněný.) Tree automata also provide further evidence that the notion of decomposition-width is a natural one, as we see in the next theorem. In our conception, a tree automaton processes a tree from leaves to root, applying a state to each node. Each node of the tree is initially labelled with a character from a finite alphabet, and the state applied to a node depends on the character written on that node, as well as the states that have been applied to its children. The automaton accepts or rejects the tree according to the state it applies to the root. The characters applied to the leaves can encode a subset of the leaves, so we can think of the automaton as either accepting or rejecting each subset of the leaves. Thus each tree automaton gives rise to a family of set-systems. The ground set of such a set-system is the set of leaves of a tree, and a subset belongs to the system if it is accepted by the automaton. We say that a family of set-systems is automatic if there is an automaton which produces the family in this way (Definition 4.5). It is natural to ask which families of set-systems are automatic, and we answer this question in Section 5.

Theorem 1.4. A class of set-systems is automatic if and only if it has bounded decomposition-width.
A class of matroids with bounded decomposition-width must have bounded branch-width (Corollary 2.8). The converse does not hold ([10, Lemma 4.1]). If M is a class of matroids and every subclass with bounded branch-width also has bounded decomposition-width, then M is pigeonhole (Definition 2.9). The class of lattice path matroids has the pigeonhole property ( [10,Theorem 7.2]). Other natural classes have an even stronger property. Let M be a class of matroids. Assume there is a value, π(λ), for every positive integer λ, such that the following holds: We let M be a matroid in M, and we let U be a subset of E(M ). If λ M (U ), the connectivity of U , is at most λ, then ∼ U has at most π(λ) equivalence classes. Under these circumstances, we say M is strongly pigeonhole (Definition 2.10). The matroids representable over a finite field ([10, Theorem 5.1]) and fundamental transversal matroids ([10, Theorem 6.3]) are strongly pigeonhole classes. An efficiently pigeonhole class is strongly pigeonhole, and has the additional property that we can efficiently compute a relation that refines ∼ U (Definition 6.4). Now we describe the structure of this article. Section 2 discusses decomposition-width, pigeonhole classes, and strongly pigeonhole classes. In Section 3 we describe the monadic logic CMS 0 . Section 4 develops the necessary tree automaton ideas. Section 5 is dedicated to the proof of Theorem 1.4. In Section 6 we prove Theorem 1.3. We also show that Theorem 1.3 holds under the weaker condition that the 3-connected matroids in M form an efficiently pigeonhole class (Theorem 6.11). (However, we require that we can efficiently compute a description of any minor of the input matroid, so this is not a true strengthening of Theorem 1.3.) Theorem 6.11 is necessary because we do not know that bicircular matroids or H-gain-graphic matroids (with H finite) form efficiently pigeonhole classes. (Although we conjecture this is the case [10,Conjecture 9.3].) However, we do know that the subclasses consisting of 3-connected matroids are efficiently pigeonhole ( [10,Theorem 8.4]).
In the final section (Section 7), we consider the question of decidability. A class of set-systems has a decidable monadic second-order theory if there is a Turing Machine (not time-constrained) which will take any sentence as input, and decide whether it is satisfied by all systems in the class. The main result of this section says that if a class of matroids has the pigeonhole property and can be defined by a sentence in monadic second-order logic, then any subclass with bounded branch-width has a decidable theory (Corollary 7.5). The special case of F-representable matroids (F finite) has been noted by Hliněný and Seese [16,Corollary 5.3]. On the other hand, the class of K-representable rank-3 matroids has an undecidable theory when K is an infinite field (Corollary 7.7).
A good introduction to automata can be found in [9]. For the basic concepts and notation of matroid theory, we rely on [22]. Recall that if M is a matroid, and (U, V ) is a partition of E(M ), then λ M (U ) is r M (U ) + r M (V ) − r(M ). Note that λ M (U ) = λ M (V ) and λ M (U ) ≤ r(M ). A set, U , is k-separating if λ M (U ) < k, and a k-separation is a partition, (U, V ), of the ground set such that |U |, |V | ≥ k, and both U and V are k-separating.

Pigeonhole classes
Now we introduce one of our principal definitions. A class of set-systems has bounded decomposition-width if those set-systems can be decomposed by subcubic trees in such a way that only a bounded amount of information flows across any of the displayed separations. This section is dedicated to formalising these ideas.
Definition 2.1. A set-system is a pair (E, I) where E is a finite set and I is a family of subsets of E. We refer to E as the ground set, and the members of I as independent sets.
In some circumstances, a set-system might be called a hypergraph and the independent sets might be called hyperedges. We prefer more matroidoriented language.
Definition 2.2. Let (E, I) be a set-system, and let U be a subset of E. Let X and X be subsets of U . We say X and X are equivalent (relative to U ), written X ∼ U X , if for every subset Z ⊆ E − U , the set X ∪ Z is in I if and only if X ∪ Z is in I.
Informally, we think of X ∼ U X as meaning that no subset of E − U can 'distinguish' between X and X . It is clear that ∼ U is an equivalence relation on subsets of U . Note that by taking Z to be the empty set, we can see that no member of I is equivalent to a subset not in I. Assuming that I is closed under subset containment (as would be the case if I were the family of independent sets in a matroid), then all subsets of U that are not in I are equivalent. Proposition 2.3. Let (E, I) be a set-system and let U and V be disjoint Proof. Let Z be an arbitrary subset of E−(U ∪V ), and assume that X ∪Y ∪Z is in I. Because Y ∪Z ⊆ E −U and X ∼ U X , it follows that X ∪Y ∪Z is in In the previous result, if (U, V ) is a partition of E, then X ∪ Y will be equivalent to X ∪ Y under ∼ U ∪V if and only if both X ∪ Y and X ∪ Y are in I, or neither is. Proposition 2.4. Let (E, I) be a set-system, and let (U, V ) be a partition of E. If q is the number of equivalence classes under ∼ U , then the number of equivalence classes under ∼ V is at most 2 q .
Proof. Let the equivalence classes under ∼ U be E 1 , . . . , E q , and let X i be a member of E i for each i. Let Z be any subset of V . We define b(Z) to be the binary string of length q, where the ith character is 1 if and only if X i ∪ Z is in I. It is clear that this string is well-defined and does not depend on our choice of the representatives X i . We complete the proof by showing that when Z, Z ⊆ V satisfy b(Z) = b(Z ), they also satisfy Z ∼ V Z . Assume this is not the case, and let X ⊆ U be such that exactly one of X ∪ Z and X ∪ Z is in I. Without loss of generality, we assume X ∪ Z ∈ I and X ∪ Z / ∈ I. Assume that X is a member of E i . Since b(Z) = b(Z ), either both of X i ∪Z and X i ∪Z are in I, or neither is. In the first case, X i ∪Z ∈ I and X ∪ Z / ∈ I, so we contradict X i ∼ U X. In the second case, X i ∪ Z / ∈ I and X ∪ Z ∈ I, so we reach the same contradiction.
A subcubic tree is one in which every vertex has degree three or one. A degree-one vertex is a leaf. Let M = (E, I) be a set-system. A decomposition of M is a pair (T, ϕ), where T is a subcubic tree, and ϕ is a bijection from E into the set of leaves of T . Let e be an edge joining vertices u and v in T . Then e partitions E into sets (U e , V e ) in the following way: an element x ∈ E belongs to U e if and only if the path in T from ϕ(x) to u does not contain v. We say that the partition (U e , V e ) and the sets U e and V e are displayed by the edge e. Define dw(M ; T, ϕ) to be the maximum number of equivalence classes in ∼ U , where the maximum is taken over all subsets, U , displayed by an edge in T . Define dw(M ) to be the minimum value of dw(M ; T, ϕ), where the minimum is taken over all decompositions (T, ϕ) of M . This minimum is the decomposition-width of M . The notion of decomposition-width specialises to matroids in the obvious way. It is an exercise to show that a class of matroids has bounded decomposition-width if and only if it has bounded decomposition-width, as defined by Král [18] and Strozecki [25,26]. Král states the next result without proof. Proof. Let (T, ϕ) be a decomposition of M and assume that whenever U is a displayed set, then ∼ U has no more than dw(M ) equivalence classes. Let T be the tree obtained from T by deleting ϕ(x) and then contracting an edge so that every vertex in T has degree one or three. Let U be any subset of E(M )−x displayed by T . Then either U or U ∪x is displayed by T . Let M be either M \x or M/x. We will show that in M , the number of equivalence classes under ∼ U is no greater than the number of classes under ∼ U or ∼ U ∪x in M . Let X and X be representatives of distinct classes under ∼ U in M . We will be done if we can show that these representatives correspond to distinct classes in M . Without loss of generality, we can assume that Z is a Thus X and X belong to distinct equivalence classes in M , as claimed. Proposition 2.6 shows that the class of matroids with decomposition-width at most k is minor-closed.
Let M be a matroid. The branch-width of M (written bw(M )) is defined as follows. If (T, ϕ) is a decomposition of M = (E(M ), I(M )), then bw(M ; T, ϕ) is the maximum value of where the maximum is taken over all partitions (U e , V e ) displayed by edges of T . Now bw(M ) is the minimum value of bw(M ; T, ϕ), where the minimum is taken over all decompositions of M . We next show that for classes of matroids, bounded decomposition-width implies bounded branch-width. Proof. Define V to be E(M ) − U . Let λ stand for λ M (U ), so that λ = r(U ) + r(V ) − r(M ). We will prove that ∼ U has at least λ + 1 equivalence classes. Let B V be a basis of M |V , and let B be a basis of M that contains B V . Then B ∩ U is independent in M |U , and Therefore we let (B ∩ U ) ∪ {x 1 , . . . , x λ } be a basis of M |U , where x 1 , . . . , x λ are distinct elements of U − B. Next we construct a sequence of distinct elements, y 1 , . . . , y λ from B V such that (B − {y 1 , . . . , y i }) ∪ {x 1 , . . . , x i } is a basis of M for each i ∈ {0, . . . , λ}. We do this recursively. Let C be the unique circuit contained in and note that x i+1 is in C. If C contains no elements of B V , then it is contained in (B ∩ U ) ∪ {x 1 , . . . , x λ }, which is impossible. So we simply let y i+1 be an arbitrary element in C ∩ B V .
We complete the proof by showing that Since we would like to consider natural classes of matroids that have unbounded branch-width, we are motivated to make the next definition. Thus a class of matroids is pigeonhole if every subclass with bounded branch-width also has bounded decomposition-width. The class of F-representable matroids is pigeonhole when F is a finite field [10, Theorem 5.1]. Note that the class of F-representable matroids certainly has unbounded decomposition-width, since it has unbounded branch-width. Some natural classes possess a stronger property than the pigeonhole property: Definition 2.10. Let M be a class of matroids. Assume that for every positive integer λ, there is a positive integer π(λ), such that whenever M ∈ M and U ⊆ E(M ) satisfies λ M (U ) ≤ λ, there are at most π(λ) equivalence classes under ∼ U . In this case we say that M is strongly pigeonhole. Proposition 2.11. If a class of matroids is strongly pigeonhole, then it is pigeonhole.
Proof. Let M be a strongly pigeonhole class, and let π be the function from Definition 2.10. We may as well assume that π is non-decreasing. Let λ be any positive integer, and let M be a matroid in M with branch-width at most λ. Let (T, ϕ) be a decomposition of M such that λ M (U )+1 ≤ λ for any set U displayed by an edge of T . Then there are at most π(λ−1)-equivalence classes under ∼ U . Thus (T, ϕ) demonstrates that dw(M ) ≤ π(λ − 1). So bw(M ) ≤ λ implies dw(M ) ≤ π(λ − 1) for each M ∈ M, and the result follows.
Remark 2.12. To see that the strong pigeonhole property is strictly stronger than the pigeonhole property, let M be the class of rank-two matroids. Let M be a member of M with t parallel pairs (where t ≥ 2). Let U be a set that contains exactly one element from each of these pairs. Then λ M (U ) = 2. However, it is easy to demonstrate that there are at least t equivalence classes under ∼ U , so this number is unbounded. This demonstrates that M is not strongly pigeonhole. However, if M is in M, then there is a decomposition of M such that whenever (U, V ) is a displayed partition, at most one parallel class contains elements of both U and V . Now we easily check that ∼ U has at most five equivalence classes, so dw(M ) ≤ 5 for all M ∈ M, implying that M is pigeonhole.

Monadic logic
In this section we construct the formal language CMS 0 (counting monadic second-order logic). We give ourselves a countably infinite supply of variables: X 1 , X 2 , X 3 , . . . . We have a unary predicate: Ind, and one binary predicate: ⊆. Furthermore, for each pair of integers p and q satisfying 0 ≤ p < q, we have the unary predicate | · | p,q . We use the standard connectives ∧ and ¬, and the quantifier ∃. The atomic formulas have the form Ind(X i ), X i ⊆ X j , or |X i | p,q . The atomic formulas Ind(X i ) and |X i | p,q have X i as their free variable, whereas the free variables of X i ⊆ X j are X i and X j . A formula is constructed by a finite application of the following rules: (i) an atomic formula is a formula, (ii) if ψ is a formula, then ¬ψ is a formula with the same free variables as ψ, (iii) if ψ is a formula, and X i is a free variable in ψ, then ∃X i ψ is a formula; its free variables are the free variables of ψ except for X i , which is a bound variable of ∃X i ψ, (iv) if ψ and φ are formulas, and no variable is free in one of ψ and φ and bound in the other, then ψ ∧ φ is a formula, and its free variables are exactly those that are free in either ψ or φ. (We can rename bound variables, so this restriction does not significantly constrain us.) Then CMS 0 is the collection of all formulas. A formula is a sentence if it has no free variables, and is quantifier-free if it has no bound variables. Definition 3.1. Monadic second-order logic, denoted by MS 0 , is the collection of formulas that can be constructed without using any predicate of the form | · | p,q .
Let (E, I) be a set-system. Let ψ be a formula in CMS 0 and let F be the set of free variables in ψ. An interpretation of ψ in (E, I) is a function θ from F into the power set of E. We think of θ as a set of ordered pairs with the first element being a variable in F and the second being a subset of E. We define what it means for the pair (E, I) to satisfy ψ under the interpretation θ. If ψ is Ind(X i ), then (E, I) satisfies ψ if θ(X i ) is in I.
. Now we extend this definition to formulas that are not atomic.
If ψ = ¬φ, then (E, I) satisfies ψ if and only if it does not satisfy φ under θ. If ψ = φ 1 ∧ φ 2 , then ψ is satisfied if (E, I) satisfies both φ 1 and φ 2 under the interpretations consisting of θ restricted to the free variables of φ 1 and φ 2 . Finally, if ψ = ∃X i φ, then (E, I) satisfies ψ if and only if there is a subset We use ψ ∨ φ as shorthand for ¬((¬ψ) ∧ (¬φ)), and ψ → φ as shorthand and is satisfied exactly when X i is interpreted as the empty set. (Here X is a variable not equal to X i .) Similarly, Sing(X i ) stands for and is satisfied exactly when X i is interpreted as a singleton set.
As is demonstrated in [20], there are MS 0 sentences that are satisfied by (E, I) if and only if I is the family of independent sets of a matroid. Furthermore, there are MS 0 sentences that characterise any minor-closed class of matroids having only finitely many excluded minors (see [20] or [14,Lemma 5.1]). On the other hand, the main theorem of [20] shows that no MS 0 sentence characterises the class of representable matroids, or the class of K-representable matroids when K is an infinite field.

Automatic classes
Our second principal definition involves families of set-systems that can be encoded by a tree, where that tree can be processed by a machine that simulates an independence oracle. We start by introducing tree automata. We use [9] as a general reference. Definition 4.1. Let T be a tree with a distinguished root vertex, t. Assume that every vertex of T other than t has degree one or three, and that if T has more than one vertex, then t has degree two. The leaves of T are the degree-one vertices. In the case that t is the only vertex, we also consider t to be a leaf. Let L(T ) be the set of leaves of T . If T has more than one vertex, and v is a non-leaf, then v is adjacent with two vertices that are not in the path from v to t. These two vertices are the children of v. We distinguish the left child and the right child of v. Now let Σ be a finite alphabet of characters. Let σ be a function from V (T ) to Σ. Under these circumstances we say that (T, σ) is a Σ-tree.

Definition 4.2.
A tree automaton is a tuple (Σ, Q, F, δ 0 , δ 2 ), where Σ is a finite alphabet, and Q is a finite set of states. The set of accepting states is a subset F ⊆ Q. We say δ 0 and δ 2 are transition rules: δ 0 is a partial function from Σ to 2 Q and δ 2 is a partial function from Σ × Q × Q to 2 Q .
We think of the automaton as processing the vertices in a Σ-tree, from leaves to root, applying a set of states to each vertex. The set of states applied to a leaf, v, is given by the image of δ 0 , applied to the Σ-label of v. For a non-leaf vertex, v, we apply δ 2 to the tuple consisting of the Σ-label of v, a state applied to the left child, and a state applied to right child. We take the union of all such outputs, as we range over all states applied to the children of v, and this union is the set we apply to v.
More formally, let A = (Σ, Q, F, δ 0 , δ 2 ) be an automaton. Let (T, σ) be a Σ-tree with root t. We let r : V (T ) → 2 Q be the function recursively defined as follows: ) if this is defined, and is otherwise the empty set. (ii) if v has left child v L and right child v R , then as long as the images in this union are all defined: if they are not then we set r(v) to be the empty set. We say that r is the run of the automaton A on (T, σ). Note that we define a union taken over an empty collection to be the empty set. Thus if a child of v has been assigned an empty set of states, then v too will be assigned an empty set of states. We say that A accepts (T, σ) if r(t) contains an accepting state.
The automaton, A = (Σ, Q, F, δ 0 , δ 2 ), is deterministic if every set in the images of δ 0 and δ 2 is a singleton. The next result shows that nondeterminism in fact gives us no extra computing power. The idea here dates to Rabin and Scott [23] (see [8,Theorem 12.3.1]). Lemma 4.3. Let A = (Σ, Q, F , δ 0 , δ 2 ) be a tree automaton. There exists a deterministic tree automaton, A = (Σ, 2 Q , F, δ 0 , δ 2 ), such that A and A accept exactly the same Σ-trees.
Proof. Note that the states in A are sets of states in A . Let F be {X ∈ 2 Q : X ∩ F = ∅}. Thus a state is accepting in A if and only if it contains an accepting state of A . For each σ ∈ Σ, we define δ 0 (σ) to be {δ 0 (σ)} when δ 0 (σ) is defined. For any σ ∈ Σ, and any X, Y ∈ 2 Q , we set as long as every image in the union is defined. Thus every image of δ 0 or δ 2 is a singleton set, so A is deterministic, as desired.
Let (T, σ) be a Σ-tree with root t. Let r and r be the runs of A and A on (T, σ). We easily establish that r(v) = {r (v)}, for each vertex v. If A accepts (T, σ), then r (t) contains a state in F . Therefore r (t) is a member of F , so r(t) = {r (t)} contains a member of F . Hence A also accepts (T, σ). For the converse, assume that A accepts (T, σ). Then r(t) = {r (t)} contains an accepting state. This means that r (t) is not disjoint from F , so A also accepts (T, σ), and we are done.
We would like to use tree automata to decide if a formula in CMS 0 is satisfied by a set-system, (E, I). This formula may have free variables, and in this case deciding whether the formula is satisfied only makes sense if we assign subsets of E to the free variables. So our next job is to formalise a way to encode this assignment into the leaf labels of a tree.
Let I be a finite set of positive integers. We use {0, 1} I to denote the set of functions from I into {0, 1}. If I is empty, then {0, 1} I is the empty set. Let Σ be a finite alphabet, and let (T, σ) be a Σ-tree. Let ϕ be a bijection from the finite set E into L(T ). Let S = {Y i } i∈I be a family of subsets of E. Now we define enc(T, σ, ϕ, S) to be a (Σ ∪ Σ × {0, 1} I )-tree with T as its underlying tree. If I is empty, then we simply set enc(T, σ, ϕ, S) to be (T, σ). Now we assume I is non-empty. If v is a non-leaf vertex of T , then it receives the label σ(v) in enc(T, σ, ϕ, S). However, if v is a leaf, then it receives a label (σ(v), s), where s is the function from I to {0, 1} taking i to 1 if and only if ϕ −1 (v) is in Y i . We think of the label on the leaf v as containing a character from the alphabet Σ, as well as a binary string where each bit of the string encodes whether or not the corresponding element We say that a tree automaton A is I-ary if I is a finite set of positive integers, the alphabet of A is Σ ∪ Σ × {0, 1} I , and every image of δ 0 is in Σ × {0, 1} I , for some finite set Σ. Under these circumstances, we blur the terminology by saying that Σ itself is the alphabet of the automaton. Definition 4.4. Let Σ be a finite set, and let A be an {i}-ary tree automaton with alphabet Σ. Let (T, σ) be a Σ-tree, and let ϕ be a bijection from the finite set E into L(T ). We define the set-system M (A, T, σ, ϕ) as follows: So the ground set of M (A, T, σ, ϕ) is in bijection with the leaves of T and the independent sets are exactly the subsets that are accepted by A, where a subset is encoded by applying 0-1 labels to the leaves. Now we are ready to give our second main definition. Note that any subclass of an automatic class is also automatic. We say that (T M , σ M ) from Definition 4.5 is a parse tree for M (relative to the automaton A). Thus a class of matroids is automatic if there is an automaton that acts as follows: for each matroid M in the class, there is a parse tree (T M , σ M ), and a bijection ϕ M from the ground set of M to the leaves, such that when the leaf labels encode the set Y i ⊆ E(M ), the automaton accepts if and only if Y i is independent. In other words, there is an automaton that will simulate an independence oracle on an appropriately chosen parse tree for any matroid in the class.
The next lemma says that if there is an automaton that simulates an independence oracle, then there is an automaton that will test any CMS 0 formula. The ideas in the proof appear to have originated with Kleene [17].
Lemma 4.7. Let A be an {i}-ary tree automaton with alphabet Σ. Let ψ be a formula in CMS 0 with free variables {X j } j∈I . There is an I-ary tree automaton A with alphabet Σ, such that for every Σ-tree (T, σ), every bijection, ϕ, from a finite set E into L(T ), and every family S = {Y j } j∈I of subsets of E, the automaton A accepts enc(T, σ, ϕ, S) if and only if the set-system M (A , T, σ, ϕ) satisfies ψ under the interpretation taking X j to Y j for each j ∈ I.
When we say that A decides ψ, we mean that A accepts enc(T, σ, ϕ, S) if and only if M (A , T, σ, ϕ) satisfies ψ under the interpretation taking X j to Y j , for any T , σ, and ϕ.
Remark 4.8. If M is an automatic class, then by definition, for each M ∈ M, we can choose T , σ, and ϕ so that M (A , T, σ, ϕ) is M . Therefore Lemma 4.7 will provide us with a way to test whether M satisfies ψ: we simply run A on the appropriately labelled tree.
Proof of Lemma 4.7. We prove the lemma by induction on the number of steps used to construct the formula ψ. Start by assuming that ψ is atomic. Assume that ψ is Ind(X j ). Then the result follows from the definitions by setting A to be A .
Next we assume that ψ is the atomic formula X j ⊆ X k . We let the state space of A be { , ×}, and let be the only accepting state. Define δ 0 so that for any α ∈ Σ and any function s ∈ {0, 1} {j,k} , the image δ 0 (α, s) is {×} if (s(j), s(k)) = (1, 0), and otherwise δ 0 (α, s) is { }. We define δ 2 so that for any α ∈ Σ, and δ 2 (α, , ) = { }. Note that as A processes the tree, it assigns × to a leaf if and only if the corresponding element of E is in Y j but not Y k . If any leaf is assigned ×, then this state is propagated towards the root. Thus A decides the formula X j ⊆ X k , as desired.
Next we will assume that ψ is the atomic formula |X j | p,q . We set the state space of A to be {0, 1, . . . , q − 1}, and we let p be the only accepting state. For any α ∈ Σ and any s ∈ {0, 1} j , we set δ 0 (α, s) to be s(j). Now for any α ∈ Σ and any x, y ∈ {0, 1, . . . , q − 1}, we set δ 2 (α, x, y) to be the residue of x + y modulo q. It is clear that A decides |X j | p,q .
We may now assume that ψ is not atomic. Assume that ψ is a negation, ¬φ. Note that the free variables of φ are {X j } j∈I . By induction, there is an automaton, A φ , that accepts enc(T, σ, ϕ, {Y j } j∈I ) if and only if M (A , T, σ, ϕ) satisfies φ under the interpretation taking each X j to Y j . By Lemma 4.3, we can assume that A φ is deterministic. Now we produce A by modifying A φ so that a state is accepting in A exactly when it is not accepting in A φ . Then A decides ¬φ.
Next we assume that ψ is a conjunction, φ 1 ∧ φ 2 . For z = 1, 2, let I z be the set of free variables in φ z . Thus I = I 1 ∪ I 2 . Inductively, there are automata A 1 and A 2 that decide φ 1 and φ 2 . For z = 1, 2, assume that A i is the automaton . The idea of this proof is quite simple: we let A run A 1 and A 2 in parallel, and accept if and only if both A 1 and A 2 accept. To that end, we set Q to be Q 1 × Q 2 , and set F to be F 1 × F 2 . If s is a function in {0, 1} I , then s Iz is the restriction of s to I z . Now we define δ 0 so that it takes (α, s) to for any α ∈ Σ and any s ∈ {0, 1} I . We similarly define δ 2 so that . It is easy to see that A acts as we desire, and therefore decides ψ.
Finally, we must assume that ψ is ∃X j φ, where the free variables of φ are {X k } k∈I∪{j} and j is not in I. By induction, we can assume that the automaton For each s ∈ {0, 1} I , we set s 0 to be the function in {0, 1} I∪j such that s 0 I = s, and s 0 (j) = 0. We similarly define s 1 ∈ {0, 1} I∪j so that . Thus δ 0 sends (α, s) to the set of states that could be applied by A φ to a leaf labelled by (α, s ), where s extends the domain of s to include j. We define δ 2 (α, q L , q R ) to be δ φ 2 (α, q L , q R ) when α is in Σ. We define the state space and the accepting states of A to be exactly those of A φ . We must now show that A decides ∃X j φ. We let (T, σ) be an arbitrary Σ-tree, and we let ϕ be a bijection from the finite set E into L(T ).
and let r be the run of A on enc(T, σ, ϕ, S). It is easy to inductively prove that r(v) ⊇ r φ (v) for every vertex v. Therefore r(t) contains an accepting state, so A accepts enc(T, σ, ϕ, S).
For the converse, assume that A accepts enc(T, σ, ϕ, S), where S = {Y k } k∈I is a family of subsets of E. Let r be the run of A on enc(T, σ, ϕ, S). We recursively nominate a state q(v) chosen from r(v), for each vertex v. Since A accepts, there is an accepting state in r(t). We define q(t) to be this accepting state. Now assume that q(v) is defined, and that the children We will now define a set Y j ⊆ E. Let v be an arbitrary leaf. We describe a method for deciding if Let r φ be the run of A φ on enc(T, σ, ϕ, S φ ). It is easy to prove by induction that r φ (v) contains q(v) for every vertex v. Therefore r φ (t) contains an accepting state, so A φ accepts enc(T, σ, ϕ, S φ ). By induction, this means that M (A , T, σ, ϕ) satisfies φ under the interpretation taking each X k to Y k for k ∈ I ∪ j. Hence ∃X j φ is satisfied by the interpretation taking X k to Y k for k ∈ I. This completes the proof that A decides ψ = ∃X j φ, and hence the proof of the lemma.

Characterising automatic classes
Now we can prove Theorem 1.4. We split the proof into two lemmas. Let M = (E, I) be an arbitrary set-system in M. Let e be an arbitrary edge in T M , and assume e is incident with the vertices u and v. The subgraph of T M obtained by deleting e contains two components, T u and T v , containing u and v respectively. By relabelling as necessary, we will assume that T v contains the root t. We let U e be the set containing elements z ∈ E(M ) such that the path from ϕ M (z) to t contains the edge e. Let V e be E − U e . We will show that the relation ∼ Ue induces at most |Q| equivalence classes. Proposition 2.4 will then imply that M has decomposition-width at most 2 |Q| . (Although (T M , ϕ M ) is not a decomposition of M , it can easily be turned into one by contracting an edge incident with the root, and then forgetting the distinction between left and right children.) Let Y and Y be arbitrary subsets of U e . Let r 1 and r 1 be the runs of A on enc(T M , σ M , ϕ M , {Y }) and enc(T M , σ M , ϕ M , {Y }) respectively. We declare Y and Y to be equivalent if and only if these runs apply the same singleton set to u; that is, if r 1 (u) = r 1 (u). It is clear that this is an equivalence relation on subsets of U e with at most |Q| equivalence classes, so it remains to show that this equivalence relation refines ∼ Ue . Assume that Y and Y are equivalent subsets, and let Z be an arbitrary subset of V e . Let r 2 and r 2 be the runs of A on enc( where the middle equality is because of the equivalence of Y and Y . Using the fact that r 2 (u) = r 2 (u), we can prove by induction that r 2 (w) = r 2 (w) for all vertices w in T v . In The other direction is known to Král [18] and to Strozecki [25,26].
Lemma 5.2. Let M be a class of set-systems. If M has bounded decomposition-width, then it is automatic.
Proof. Let K be an integer such that dw(M ) ≤ K for all members M ∈ M. Thus, any member M has a decomposition such that each displayed set contains at most K equivalence classes. We construct a tree automaton, A, that decides the formula Ind(X i ). The set of states of A is Let M = (E, I) be an arbitrary set-system in M, and let (T, ϕ) be a decomposition of M , where ∼ U has at most K equivalence classes for any set U displayed by an edge of T . We start by showing how to construct the parse tree (T M , σ M ) by modifying T . First, we arbitrarily choose an edge of T , and subdivide it with the new vertex t, where t will be the root of T M . For each non-leaf vertex of T , we make an arbitrary decision as to which of its children is the left child, and which is the right. This describes the tree T M . The bijection ϕ M is set to be identical to ϕ.
For each edge e, let U e be the set of elements z ∈ E such that the path from ϕ M (z) to t contains the edge e. Then ∼ Ue induces at most K equivalence classes. Let e be some function from the subsets of U e into {q 1 , . . . , q K } such that e (X) = e (X ) implies X ∼ Ue X . We think of e as applying labels to the equivalence classes of ∼ Ue . (Although we allow the possibility that equivalent subsets under ∼ Ue receive different labels under e . In other words, the equivalence relation induced by e refines ∼ Ue .) For each q j in the image Im( e ), we arbitrarily choose a representative subset Rep e (q j ) ⊆ U e such that e (Rep e (q j )) = q j .
Next we describe the function σ M , which labels each vertex of T M with a function. Let u be a leaf of T M . Then σ M (u) is a function, f , whose domain is {0, 1}. In the case that u is also the root of T M , we set f (0) to be the symbol indep if ∅ is in I, and otherwise we set f (0) to be the symbol dep.
Now assume that u is a non-root leaf, and let e be the edge incident with u. Then . Now let u be a non-leaf vertex. Let e L and e R be the edges joining u to its children. Then σ M (u) is a function f and the domain of f is Im( e L )×Im( e R ). Let (q j , q k ) be in Im( e L )×Im( e R ), and assume X j ⊆ U e L is the representative Rep e L (q j ), while X k is Rep e R (q k ). Assume that u is not the root, and let e be the first edge in the path from u to t.
Now we have completed our description of σ M , which labels the vertices of T M with functions. Therefore ( Our next task is to describe the automaton, A. As we have said, the state space is Q = {indep, dep, q 1 , . . . , q K }. The alphabet is Σ∪Σ×{0, 1} {i} , where Σ is the set of partial functions we described in the previous paragraph. The only accepting state is indep. To define the transition rule δ 0 , we consider the input (f, s), where f is a function from {0, 1} into Q, and s is a function in {0, 1} {i} . Then we define δ 0 (f, s) to be {f (s(i))}. Now we consider the transition rule δ 2 . Let f be a function whose domain is a member of This completes our description of the automaton A. Note that it is deterministic.
and let e be the first edge on the path from u to t. Let q be the state applied to u by the run of A on enc( Proof. Assume that u has been chosen so that it is as far away from t as possible, subject to the constraint that the claim fails for u. Let f be the function applied to u by the labelling σ M .
First assume that u is a leaf, so that then q = f (0) = e (∅). Now e (Rep e (q)) = q, by definition, so Rep e (q) ∼ Ue ∅, by the nature of the function e . Therefore (Y i ∩ U e ) ∼ Ue Rep e (q), as desired. The other possibility is that Now we must assume that u is not a leaf, so that u is joined to its children, u L and u R , by the edges e L and e R . Assume that u receives the label f in enc(T M , σ M , ϕ M , {Y i }). Let q L and q R be the states applied to u L and u R by the run of A on enc( The construction of f and A means that q = e (X j ∪ X k ). Obviously e (Rep e (q)) = q, so the nature of the function e implies (X j ∪ X k ) ∼ Ue Rep e (q). Now we see that (Y i ∩ U e ) ∼ Ue Rep e (q), so u fails to provide a counterexample after all.
Assume that t is not a leaf, and that the edges e L and e R join t to its children, u L and u R . Let q L and q R be the states applied to u L and u R . Let X j be Rep e L (q L ), and let X k be Rep e R (q R ).
and X j ∪ X k belong to I, or neither does. In the former case, A applies indep to t during its run on enc(T M , σ M , ϕ M , {Y i }), and hence accepts. In the latter case, A applies dep, and does not accept. Therefore A decides Ind(Y i ), exactly as we want.
Recall that a class of matroids is pigeonhole if every subclass with bounded branch-width also has bounded decomposition-width. Now we can deduce the following (perhaps not obvious) fact. Proof. Assume that M is pigeonhole. For every positive integer, λ, there is an integer ρ(λ) such that any matroid in M with branch-width at most λ has decomposition-width at most ρ(λ).
Let λ be an arbitrary positive integer. Let M λ be the class of matroid in M with branch-width at most λ. As M λ has bounded decomposition-width, Lemma 5.2 implies that it is an automatic class. Let A be an {i}-ary automaton such that for every matroid M ∈ M λ , there is a parse tree (T M , σ M ) and a bijection ϕ M : The predicate is satisfied exactly by interpretations that take X 2 to a basis of a matroid. Similarly, is satisfied exactly by the interpretations that take X 1 to coindependent sets. Now We have just shown that any matroid in this class has decomposition-width at most ρ * (λ), and this establishes the result.
We do not know of a proof of Corollary 5.3 that does not rely on Theorem 1.4. We do not know if the dual of a strongly pigeonhole class must be strongly pigeonhole, but we conjecture that this is the case.

Complexity theory
In this section, we discuss complexity theoretical applications of tree automata. We start with a simple observation. Various models of matroid computation have been studied. Here, we will concentrate on classes of matroids that have compact descriptions. We start with a partial decomposition containing a single block, and successively partition blocks into two parts, until every block is a singleton set. This process therefore takes n − 1 steps. At each step, we ensure that each edge has width at most 3λ + 1, so at the end of the process, we will have the desired decomposition. Assume that U is a block in the partition with |U | > 1. Let l be the leaf corresponding to U , and let e be the edge incident with l (if T is not a single vertex). Let V be E − U . We inductively assume that the weight of e is at most 3λ + 1. If it is less than 3λ + 1, then we arbitrarily choose an element u ∈ U , subdivide e and join a new leaf to this new vertex. We label the new leaf with {u}, and relabel the leaf corresponding to U with U − {u}. Therefore we can assume that the width of e is exactly 3λ + 1, and hence λ M (U ) = 3λ (assuming T has more than one vertex).
We use the greedy algorithm to find an arbitrary basis, B, of M in O(np(n)) steps. For any subset X ⊆ U , define λ B (X) to be The proof of [21,Theorem 5.2] shows that the width of every edge in the new decomposition is at most 3λ + 1, so we can reiterate this process until we have a branch decomposition.
We wish to develop efficient model-checking algorithms for strongly pigeonhole matroid classes. We have to strengthen this condition somewhat, by insisting not only that there is a bound on the number of equivalence classes, but that we can efficiently compute the equivalence relation (or a refinement of it). Under these circumstances, we say that M is efficiently pigeonhole (relative to ∆).
It follows immediately that if a class of matroids is efficiently pigeonhole, then it is strongly pigeonhole. We will later see that many natural classes are efficiently pigeonhole. Proof. We start by applying Proposition 6.3 to obtain a branchdecomposition with width at most 3λ + 1. This construction takes O(8 λ n 3.5 p(n)) steps. Let T be the tree underlying the branch-decomposition, and let ϕ be the bijection from E(M ) to the leaves of T . We construct T M by subdividing an edge of T with a root vertex, t, and distinguishing between left and right children. We let ϕ M be ϕ. If U is a set displayed by an edge of T M , then λ M (U ) ≤ 3λ. We let K be π(3λ), where π is the function provided by Definition 6.4.
From this point we closely follow the proof of Lemma 5.2. For each edge, e, in T M , we perform the following procedure. Let u be the endvertex of e that is further from t in T M , and define U e as in the proof of Lemma 5.2. We will construct representative subsets, Rep e (q), of U e , where q is a label in {q 1 , . . . , q K }, in such a way that distinct representative states are inequivalent under ≈ Ue . At the same time, we will construct a function, f , which will be applied to u by the labelling function σ M .
First assume that u is a leaf, so that U e = {ϕ −1 M (u)}. The domain of f will be {0, 1}. As in Lemma 5.2, we must consider the case that u is also the root of T M . In this case, we set f (0) to be indep, and set f (1) to be indep or dep depending on whether {ϕ −1 M (u)} is independent. Now assume that u is a non-root leaf. Let ∅ be Rep e (q 1 ), and set f (0) to be q 1 . In O(Kn c ) steps, we test whether {ϕ −1 M (u)} ≈ Ue ∅. If so, then we set f (1) to be q 1 . Assuming that {ϕ −1 M (u)} ≈ Ue ∅, we define Rep e (q 2 ) to be U e = {ϕ −1 M (u)}, and we set f (1) to be q 2 . Now assume that u is not a leaf. Let e L and e R be the edges joining u to its children. Recursively, we assume that Rep e L (q) is defined when q is in {q 1 , . . . , q s L }, and Rep e R (q) is defined when q is in {q 1 , . . . , q s R }. The function f will have domain {q 1 , . . . , q s L } × {q 1 , . . . , q s R }. For each of the O(K 2 ) pairs, (q j , q k ), with q j ∈ {q 1 , . . . , q s L } and q k ∈ {q 1 , . . . , q s R }, we perform the following steps. Let X j stand for Rep e L (q j ) and X k stand for Rep e R (q k ). In time bounded by O(K 2 n c ), we check whether X j ∪ X k is equivalent under ≈ Ue to any of the (at most K) representative subsets of U e that we have already constructed. If not, then we define Rep e (q l ) to be X j ∪ X k , where q l is the first label in {q 1 , . . . , q K } that has not already been assigned to a representative subset of U e . In this case, we set f (q j , q k ) to be q l . However, if X j ∪ X k is equivalent under ≈ Ue to a previously chosen representative, say Rep e (q m ), then we set f (q j , q k ) to be q m . Note that the number of edges in T M is 2n − 2, so this entire procedure takes O(n(K 4 n c )) steps.
Finally, let the children of the root, t, be u L and u R , and assume that t is joined to these children by e L and e R . Assume Rep e L (q) is defined when q is in {q 1 , . . . , q s L }, and Rep e R (q) is defined when q is in {q 1 , . . . , q s R }. Again, f has domain {q 1 , . . . , q s L } × {q 1 , . . . , q s R }. We define f (q j , q k ) to be indep if Rep e L (q j ) ∪ Rep e R (q k ) is independent, and we let f (q j , q k ) be dep otherwise. Constructing this function takes O(K 2 p(n)) steps. Now we have completed the construction of the parse tree (T M , σ M ), and we have done so in O((8 λ n 3.5 + K 2 )p(n) + K 4 n c+1 ) steps.
To complete the proof, we must check that (T M , σ M ) genuinely behaves as a parse tree should. The automaton A is exactly as in Lemma 5.2. But the statement of Claim 5.2.1 still holds in this case, and can be proved by the same argument. There is one point which deserves some attention: with the notation as in the proof of Claim 5.2.1, the fact that the state q is applied to u means that (X j ∪ X k ) ≈ Ue Rep e (q). But the definition of ≈ Ue then implies (X j ∪ X k ) ∼ Ue Rep e (q), and hence (Y i ∩ U e ) ∼ Ue Rep e (q), exactly as in Claim 5.2.1. The rest of the proof follows exactly as in Lemma 5.2. Now Theorem 1.3 follows immediately from Proposition 6.1 and Theorem 6.5.
6.1. Automata and 2-sums. In [10], we extend Hliněný's Theorem to the classes of bicircular matroids and H-gain-graphic matroids (where H is a finite group). If we knew that these classes were efficiently pigeonhole, then this would follow immediately from Theorem 1.3, but we only know that the classes of 3-connected H-gain-graphic (or bicircular) matroids are efficiently pigeonhole. In this section, we prove that this is sufficient to extend Hliněný's Theorem to the entire classes (not only the 3-connected members). Because our arguments here do not depend on the nature of bicircular or H-gain-graphic matroids, we operate at a greater level of generality.
Let M 1 and M 2 be matroids on the ground sets E 1 and E 2 . Assume that E 1 ∩ E 2 = {e}, where e is neither a loop nor a coloop in M 1 or in M 2 . The parallel connection, P (M 1 , M 2 ), along the basepoint e, has E 1 ∪ E 2 as its ground set. Let C i be the family of circuits of M i for i = 1, 2. The family of circuits of P (M 1 , M 2 ) is Note that P (M 1 , M 2 )|E i = M i , for i = 1, 2. The 2-sum of M 1 and M 2 , written M 1 ⊕ 2 M 2 , is defined to be P (M 1 , M 2 )\e.
Let T be a tree, where each node, x, is labelled with a matroid, M x . Let the edges of T be labelled with distinct elements, e 1 , . . . , e m . Let x and y be distinct nodes. We insist that if x and y are not adjacent, then E(M x ) and E(M y ) are disjoint. If x and y are joined by the edge e i , then E(M x ) ∩ E(M y ) = {e i }, where e i is neither a loop nor a coloop in M x or M y . Such a tree describes a matroid, as we now show. If e i is an edge joining x to y, then contract e i from T , and label the resulting identified node with P (M x , M y ). Repeat this procedure until there is only one node remaining. We use P (T ) to denote the matroid labelling this one node. It is an easy exercise to see that P (T ) is well-defined, so that it does not depend on the order in which we contract the edges of T . We define ⊕ 2 (T ) to be P (T )\{e 1 , . . . , e m }. If M is a connected matroid, there exists a (not necessarily unique) tree T satisfying M = ⊕ 2 (T ) where every node of the tree is labelled with a 3-connected matroid. Definition 6.6. Let ∆ be a succinct representation of M, a class of matroids. We say that ∆ is minor-compatible if there is a polynomial-time algorithm which will accept any tuple (∆(M ), X, Y ) when M ∈ M and X and Y are disjoint subsets of E(M ), and return a string of the form ∆(M/X\Y ).
It is clear that representating graphic matroids with graphs or representable matroids with matrices gives us examples of minor-compatible succinct representations.
Theorem 6.7. Let M be a minor-closed class of matroids with a minorcompatible representation, ∆. Assume that {M ∈ M : M is 3-connected} is efficiently pigeonhole. There is a fixed-parameter tractable algorithm (with respect to the parameter of branch-width) which accepts as input any ∆(M ) when M ∈ M and returns a parse tree for M . Remark 6.8. Theorems 6.5 and 6.7 are independent of each other, as we now discuss. Since any subclass of an efficiently pigeonhole class is efficiently pigeonhole, we can easily construct an efficiently pigeonhole class that is not minor-closed, and this class will therefore not be covered by Theorem 6.7. On the other hand, we can construct a minor-closed class M such that {M ∈ M : M is 3-connected} is efficiently pigeonhole, and yet M is not even strongly pigeonhole. Such a class will be covered by Theorem 6.7, but not by Theorem 6.5. For an example, let n ≥ 3 be an integer, and let U + 2,n be the rank-2 matroid obtained from U 2,n by replacing each element with a parallel pair. If U contains exactly one element from each parallel pair, then it is 3-separating, and yet ∼ U has at least n equivalence classes. So if M is the smallest minor-closed class containing {U + 2,n : n ≥ 3}, then M is not strongly pigeonhole. However, every 3-connected member of M is uniform. It is therefore not difficult to show that {M ∈ M : M is 3-connected} is efficiently pigeonhole with respect to any minor-compatible representation. Proof of Theorem 6.7. The ideas here are very similar to those in the proof of Theorem 6.5, but there are several technical complications introduced by the fact that we have to deal with non-3-connected matroids as a separate case. Let M ∈ M be a matroid with ground set E and branch-width λ. We assume that we are given the description ∆(M ). The algorithm we describe in this proof runs in polynomial-time, and to ensure that it is fixed-parameter tractable with respect to λ, we will be careful to observe that whenever we call upon a polynomial-time subroutine, λ does not appear in the exponent of the running time.
To start, we consider the case that M is connected, and at the end of the proof we will show that this is sufficient to establish the entire theorem.
Discussion in [1] shows that we can use a 'shifting' algorithm to find a 2-separation of M , if it exists. This takes O(|E| 3 ) oracle calls. Therefore we can test whether M is 3-connected in polynomial time. If M is 3-connected, then we use Theorem 6.5 to construct a parse tree for M . So henceforth we assume that M is connected but not 3-connected.
Constructing T M . We have noted that it takes O(|E| 3 ) oracle calls to find a 2-separation of M . Assume that (U 1 , U 2 ) is such a separation. Then M can be expressed as the 2-sum of matroids M 1 and M 2 , where the ground set of M i is U i ∪e, and e is an element not in E. Both M 1 and M 2 are isomorphic to minors of M , and hence are in M. If B 1 is a basis of M |U 1 , and B is a basis of M containing B 1 , then B ∩ U 2 does not span U 2 , so we can let x be an element in U 2 − cl M (B ∩ U 2 ). Now M 1 can be produced from M by contracting B ∩ U 2 and deleting all elements in U 2 − (B ∪ x). We then relabel x as e. From this discussion, and the fact that ∆ is minor-compatible, it follows that we can construct ∆(M 1 ) and ∆(M 2 ) in polynomial time. By reiterating this procedure, we can construct a labelled tree, T , such that M = ⊕ 2 (T ). Each node, x, of T is labelled by a 3-connected matroid, M x , with at least three elements, and for each such node we have an associated string ∆(M x ). Let the edge labels of T be e 1 , . . . , e m . We arbitrarily choose to subdivide e m to make a root vertex. Say that e m joins x L to x R in T . We delete e m , add a new node, t, and edges e m,L and e m,R joining t to x L and x R . At the same time, we relabel e m as e m,L in M x L and as e m,R in M x R . Let T be the tree that we obtain in this way. We think of t as being the root of T . We associate t with the matroid M t , which is a copy of U 1,2 with ground set {e m,L , e m,R }. Note that ⊕ 2 (T ) = ⊕ 2 (T ) = M .
For each non-root node, x, of T , the labelling matroid M x is isomorphic to a minor of M . Therefore bw(M x ) ≤ λ [22,Proposition 14.2.3]. We use Proposition 6.3 to construct a branch-decomposition of M x with width at most 3λ + 1. Let T x be the tree underlying the branch-decomposition of M x , and let ϕ x be the bijection from E(M x ) to the leaves of T x . We define the tree T t to be a path of two edges, and we define ϕ t so that it applies the labels e m,L and e m,R to the leaves and t to the middle vertex. We say that ϕ t (e m,L ) is the left child of t and ϕ t (e m,R ) is the right child.
Let x be a non-root node in T and consider the path in T from x to t. Let e α be the first edge in this path, so that e α is a basepoint in the ground set of M x . Then we say that e α is the parent basepoint of T x . For each internal vertex, u, of T x , note that u is adjacent to two vertices that are not in the path from u to ϕ x (e α ), where e α is the parent basepoint of T x . We say that these two vertices are the children of u, and we make an arbitrary distinction between the left child and the right child.
The collection ∪{T x }, where x ranges over all nodes of T , forms a forest that we now assemble into a single tree, T M . For each edge, e α , in {e 1 , . . . , e m−1 , e m,L , e m,R }, we perform the following operation. Let the node x of T be chosen so that e α is the parent basepoint of T x , and let y be the other end-vertex of e α in T . Let u be the vertex of T x that is adjacent to the leaf ϕ x (e α ). We delete ϕ x (e α ) from T x and then identify u with the leaf ϕ y (e α ) in T y . We say that the edge in T y that is now incident with u is a basepoint edge in T M . If u is a non-leaf vertex of T x , we allow u to carry its children over from T x to T M . In the case that a child of u in T x represents a basepoint element, e α , then that child of u in T M will be an internal vertex of another tree, T y . Now T M is a rooted tree where every non-leaf vertex has a left child and a right child. Figure 1 illustrates this construction by showing the tree T , along with the collection of decompositions ∪{T x }. In these diagrams, the basepoints of the parallel connections are coded via colour. In Figure 2, we have assembled these trees together into the tree T M . Every edge of T M is an edge of exactly one tree T x , where x is a node of T . Our method of construction means that if u is a non-leaf vertex of T M , then both the edges joining u to its children are edges of the same tree T x . Moreover, if x is a non-root node of T , then the only edge of T x not contained in T M is the one incident with ϕ x (e α ), where e α is the parent basepoint of T x . Let e be any edge of T M , and let u be the end-vertex of e that is further away from t in T M . Then we say that u is the bottom vertex of e.
Note that there is a bijection, ϕ M , from E to the leaves of T M . In particular, ϕ M restricted to E(M x ) ∩ E is equal to ϕ x restricted to the same set, for any node x. It is easy to check that if the set U is displayed by an edge of T M , then λ M (U ) ≤ 3λ. This is obvious when U is a subset of E(M x ), where x is a non-root node of T , for then U is also displayed by the tree T x .
It is only a little more difficult to verify when U is not contained in E(M x ) for any x.
Defining three pieces of notation. Next we describe three related notations for subsets of E and E(M x ). Let e be any edge of T M , and let desc(e) be the set of elements z ∈ E such that the path in T M from ϕ M (z) to t passes through e. In Figure 2, when e is the dashed edge, the set desc(e) is indicated by the hollow vertices. Note that desc(e) is not necessarily contained in E(M x ) for any node x of T , but that it is contained in E.
Next, we let e be any edge of T M and let x be the node of T such that e is an edge of the tree T x . If x is a non-root node of T , then we can assume that e α is the parent basepoint of T x . We let U e be the set of elements z ∈ E(M x ) such that the path in T x from ϕ x (z) to ϕ x (e α ) contains e. If x is the root t, and e joins t to ϕ t (e m,L ) then we define U e to be {e m,L }, and if e joins t to ϕ t (e m,R ), then we define U e to be {e m,R }. In Figure 1, the righthand diagram contains a dashed edge e, and the set U e is indicated by hollow vertices. Note that U e is a subset of E(M x ), and unlike desc(e), the set U e may not be contained in E, as it may contain basepoint elements. As U e is displayed by the edge e in T x , we have that λ Mx (U e ) ≤ 3λ.
Finally, we let Y i be any subset of E, and we let x be a node of T . We recursively describe a subset, . Now we assume that x is not a leaf. Let e α 1 , . . . , e αs be the labels of edges in T that are incident with x but not on the path from x to t. Now define Y i x so that it contains Y i ∩ E(M x ), along with any basepoint e α j such that if y labels the other node incident with e α j , then e α j ∈ cl My ( Y i y ). Note that this means that any element of Y i x is either contained in Y i ∩ E(M x ), or is a basepoint element. In any case, every element of Y i x is in E(M x ). In Figure 1, we let x be the top-left node in the lefthand diagram, and we let Y i be the set indicated by the hollow vertices. Then Y i x contains the single hollow vertex in E(M x ), as well as the element a, but not the element b. Note that by construction, With these definitions established, we can proceed.
Constructing representative subsets. Let e be any edge of T M , and let U e ⊆ E(M x ) be as defined above. Recall that λ Mx (U e ) ≤ 3λ. Noting that {M ∈ M : M is 3-connected} is efficiently pigeonhole and M x is 3connected, we refer to Definition 6.4, and we let π be the function from that definition. Let K be π(3λ), and note that K is constant with respect to the size of E. Let ≈ Ue be the equivalence relation from Definition 6.4. Then we can decide whether two subsets of U e are equivalent under ≈ Ue in time bounded by O(K|E| c ). Furthermore, ≈ Ue has at most K equivalence classes.
Note that T M has exactly 2|E| − 2 edges. For each such edge, e, we will construct, in polynomial time, a set of representatives such that each representative is a subset of U e . Each representative will be an independent subset of U e , and distinct representatives will represent different (≈ Ue )-classes. We will apply the labels q 1 , . . . , q K to representative subsets, and use Rep e (q) to denote the representative with label q, assuming that it exists. We do not claim that our set of representatives is complete, so there may be (≈ Ue )-classes that do not have a representative.
Let x be the node of T such that e is an edge of T x . If x = t, then T x has a parent basepoint, e α , and we let u be the end-vertex of e that is further from ϕ x (e α ) in T x . If x = t, then let u be the end-vertex of e that is not the root.
First assume that u is a leaf in T x . Then U e = {ϕ −1 x (u)}. In this case, we choose ∅ as a representative, and apply the label q 1 to it, so that ∅ = Rep e (q 1 ). Because M has a succinct representation, we can check in polynomial time whether U e is dependent. If so, we take no further action, so assume that U e is independent in M x . In polynomial time we can check whether U e ≈ Ue ∅ holds. If so, then we are done. If U e ≈ Ue ∅, then we choose U e as the representative with label q 2 , so that U e = Rep e (q 2 ). Now we assume that u is not a leaf of T x . Let e L and e R be the edges joining u to its children in T x . Recursively, we assume that we have chosen a representative subset Rep e L (q) ⊆ U e L whenever q is in {q 1 , . . . , q s L }, and that Rep e R (q) is defined when q is in {q 1 , . . . , q s R }. For each pair (q j , q k ) in {q 1 , . . . , q s L } × {q 1 , . . . , q s R }, we let X j stand for Rep e L (q j ) and X k stand for Rep e R (q k ). If X j ∪ X k is dependent in M x , then we move to the next pair. Assuming that X j ∪ X k is independent, we check in polynomial time whether X j ∪X k is equivalent under ≈ Ue to any of the representative subsets of U e that we have already constructed. If so, we are done. If not, then we let q l be the first label in {q 1 , . . . , q K } not already assigned to a subset of U e , and we define Rep e (q l ) to be X j ∪ X k .
Labelling the vertices. The alphabet of our automaton is going to contain a set of functions. Our next job is show how we apply, in polynomial time, functions in the alphabet to the vertices of T M . Let u be a vertex of T M , and assume that u is the bottom vertex of the edge e. Let x be the node of T such that e is an edge in the tree T x .
First, we assume that u is a leaf of T M . Then U e = ϕ −1 M (u). We label u with a function, f , with the domain {0, 1}. Set f (0) to be q 1 , recalling that ∅ is the representative Rep e (q 1 ). If U e is dependent in M x , then we set f (1) to be the symbol dep. Assume that U e is independent. If U e ≈ Ue ∅, then we set f (1) to be q 1 . Otherwise we set f (1) to be q 2 , recalling that in this case U e = Rep e (q 2 ). Henceforth we assume that u is not a leaf of T M . Let e L and e R be the edges joining u to its children in T M .
Assume that e is not a basepoint edge. This implies that U e is the disjoint union of U e L and U e R . (If e were a basepoint edge, then U e would be a singleton subset of E(M x ), whereas U e L and U e R would be subsets of E(M y ) for some other node y of T .) Assume that Rep e L (q) is defined when q is in {q 1 , . . . , q s L }, and that Rep e R (q) is defined when q is in {q 1 , . . . , q s R }. In this case, we label u with a function, f , having {dep, q 1 , . . . , q s L } × {dep, q 1 , . . . , q s R } as its domain. We define the output of f to be dep on any input that includes the symbol dep. Now assume that X j is Rep e L (q j ) and X k is Rep e R (q k ), for some 1 ≤ j ≤ s L and some 1 ≤ k ≤ s R . If X j ∪ X k is dependent in M x , then define f (q j , q k ) to be dep. Otherwise, X j ∪ X k is equivalent under ≈ e to some representative subset of U e . We find this representative, say Rep e (q l ), in polynomial time, and we set f (q j , q k ) to be q l . Now we assume that e is a basepoint edge. Assume that in T x , e is incident with the leaf ϕ x (e α ), where e α is in {e 1 , . . . , e m−1 , e m,L , e m,R }. Therefore U e = {e α }. Note that e L and e R are edges of T y , where y is the node of T joined to x by e α . Assume that Rep e L (q) has been chosen when q ∈ {q 1 , . . . , q s L }, and Rep e R (q) is defined when q ∈ {q 1 , . . . , q s R }. We will apply to u a function, f , whose domain is again {dep, q 1 , . . . , q s L } × {dep, q 1 , . . . , q s R }, and whose codomain is {dep, q 1 , q 2 }. The output of f is dep on any input including dep. Consider the input (q j , q k ). Let X j and X k be Rep e L (q j ) and Rep e R (q k ) respectively. If X j ∪ X k is dependent, then we set f (q j , q k ) to be dep. Now we assume that X j ∪ X k is independent. If X j ∪ X k ∪ {e α } is independent in M y then we set f (q j , q k ) to be q 1 . Otherwise, X j ∪ X k ∪ {e α } is dependent in M y , and we set f (q j , q k ) to be q 1 if U e ≈ Ue ∅ holds, and q 2 if U e ≈ Ue ∅.
Finally, the root t is labelled with a function, f , that takes {dep, q 1 , q 2 } 2 as input. Any ordered pair that contains dep produces dep as output. Similarly, f (q 2 , q 2 ) = dep. Any other ordered pair produces the symbol indep as output.
Now we have described the function that we apply to each vertex of T M . Let σ M be the labelling that applies these functions. Thus (T M , σ M ) is a Σ-tree, where Σ contains functions whose domain is either {0, 1} or sets of the form {dep, q 1 , . . . , q s L } × {dep, q 1 , . . . , q s R }, and whose codomain is {dep, indep, q 1 , . . . , q K }.
Constructing the automaton. Now that we have shown how to efficiently construct the Σ-tree (T M , σ M ), it is time to consider the workings of the automaton, A. The state space, Q, of A is the set {dep, indep, q 1 , . . . , q K }. The alphabet is Σ ∪ Σ × {0, 1} {i} , where Σ is the set of functions into Q that we have previously described. The only accepting state is indep. The transition rule, δ 0 , acts as follows. If f is a function from {0, 1} into Q, and s is a function in {0, 1} {i} , then δ 0 (f, s) = {f (s(i))}. Similarly, δ 2 is defined so that if f is a function in Σ, and (α, β) is in the domain of f , then δ 2 (f, α, β) = {f (α, β)}. This completes the description of A. Note that it is a deterministic automaton.
Proof of correctness. We must now prove that (T M , σ M ) truly is a parse tree relative to the automaton A. That is, we must prove that A accepts a subset of the leaves of T M if and only if the corresponding set is independent in M . Lemma 6.9. Let Y i be a subset of E, and let u be a non-leaf vertex of T M . Let e L and e R be the edges of T M joining u to its children. Let y be the node of T such that e L and e R are edges of T y .
Proof. We start by defining D, a set of nodes in T . Let y be a node in T . If there exists d ∈ desc(e L ) ∪ desc(e R ) such that the path in T M from ϕ M (d) to u uses an edge in the tree T y , then y is in D, and otherwise y / ∈ D. If y = y and d is in desc(e L ), we say y is a left vertex, if d is in desc(e R ), then y is a right vertex. We say that y is both a left and a right vertex of D, and note that any vertex in D − y is either left or right, but not both. Let y 0 , . . . , y s be an ordering of the vertices in D such that y 0 = y, and whenever y k is on the path from y j to y in T , k ≤ j.
To prove (i), we let C be a circuit of M y contained in Y i y ∩ (U e L ∪ U e R ). We will construct a sequence of circuits, C 0 , . . . , C s , of P (T ) such that: (a) C j is contained in for each j, and (b) if 0 ≤ k ≤ j, and e is a basepoint edge on the path from y k to y in T , then e / ∈ C j . Assume we succeed in constructing this sequence. Then C s does not contain any element in {e 1 , . . . , e m−1 , e m,L , e m,R }, so it is a circuit of P (T )\{e 1 , . . . , e m−1 , e m,L , e m,R } = M , and is contained in Y i ∩ (desc(e L ) ∪ desc(e R )). So at this point the proof of (i) will be complete.
For C 0 , we can just use C. Assume we have constructed C j−1 . Let e α be the parent basepoint of T y j , so that e α is the first edge on the path in T from y j to y. Assume that e α joins y j to y k , where k < j. This means that e α is in E(M y k ). If e α / ∈ C j−1 , then we set C j to be C j−1 and we are done. Therefore we assume that e α is in C j−1 . Because C j−1 is contained in the union of and e α is in E(M y k ) it follows that e α is in Y i y k . The definition of Y i y k now means that e α is in cl My j ( Y i y j ). Let C be a circuit of M y j such that e α ∈ C ⊆ ( Y i y j ∪ e α ). The definition of the parallel connection means that (C j−1 − e α ) ∪ (C − e α ) is a circuit of P (T ), so we set C j to be this circuit. This shows that we can construct the claimed sequence of circuits, and completes the proof of (i). Now we prove (ii). Assume that Y i ∩ desc(e L ) and Y i ∩ desc(e R ) are independent in M , but that C is a circuit contained in Y i ∩ (desc(e L ) ∪ desc(e R )). We construct a sequence C s , C s−1 , . . . , C 0 of circuits of P (T ) such that: for each j, and (b) for each j, there is a left vertex y L and a right vertex y R such that C j contains elements of both Y i y L and Y i y R . Assuming we succeed in constructing this sequence, C 0 will certify that . From this it follows that we can take C s to be C. Now assume that we have constructed C j . If C j contains no elements of Y i y j , then we set C j−1 to be C j . So assume that C j ∩ Y i y j = ∅. Let e α be the parent basepoint of T y j , and assume that e α joins y j to y k in T , where k < j. It cannot be the case that C j is a circuit of Y i y j , or else condition (b) would be violated. Therefore C j can be expressed as (C − e α ) ∪ (C j−1 − e α ), where C and C j−1 are circuits of P (T ) containing e α , and C is a circuit of M y j , while C j−1 intersects E(M y j ) only in e α . Note that the circuit C implies that e α is in Y i y k . If y j is a left vertex, then so is y k , so C j−1 must also contain an element from Y i y R , where y R is some right vertex. Therefore C j−1 is the desired next circuit in the sequence. The symmetric argument applies when y j and y k are both right vertices. Proof. We assume that the lemma fails for the vertex u, and that subject to this constraint, u has been chosen so that it is as far away from t as is possible in T M . Let f be the function applied to u by the labelling σ M . Proof. Let us assume that u is a leaf. Note that desc(e) = U e = {ϕ −1 x (u)}. The label applied to u in the Σ-tree enc( and otherwise s(i) = 0. We have defined A in such a way that q = f (s(i)).
Assume that Y i ∩ desc(e) is dependent. The only way this can occur is if ϕ −1 x (u) is a loop contained in Y i . In this case q = f (s(i)) = f (1), and f (1) = dep, by the construction of f . Therefore u does not provide a counterexample to the lemma, contrary to assumption. Hence Y i ∩ desc(e) is independent in M .
Next assume that q = dep. But q is f (s(i)), and this takes the value dep only if s(i) = 1 and Y i ∩desc(e) = U e , and furthermore, this set is dependent. Again, u does not provide a counterexample, so we conclude that q = dep.
Observe that e is not a basepoint edge, as this would imply | desc(e)| ≥ 2, and this is not the case when u is a leaf. From this we deduce that where Rep e (q 1 ) is the empty set. Thus Y i x ∩ U e and Rep e (q) are actually equal, and thus certainly equivalent under ∼ Ue , as desired. Now we assume Then q = f (s(i)) = f (1), and this value is either q 1 or q 2 . In the former case, U e ≈ Ue ∅, so ( Y i x ∩ U e ) ≈ Ue ∅. As ∅ is Rep e (q 1 ), we are done. Therefore we consider the case that q = q 2 . In this case Rep e (q 2 ) = U e = Y i x ∩ U e , so Lemma 6.10 holds. This contradiction means that Claim 6.10.1 is proved.
Because Claim 6.10.1 tells us that u is not a leaf, we let u L and u R be the children of u in T M , and we assume that these are the bottom vertices of the edges e L and e R . Note that desc(e) is the disjoint union of desc(e L ) and desc(e R ). Observe also that e L and e R are edges of the same tree, T y , where y is a node of T that may or may not be equal to x. If y = x, then e is a basepoint edge. Let q L and q R be the states applied to u L and u R by the run of A on enc(T M , σ M , ϕ M , {Y i }). Our inductive assumption on u means that Lemma 6.10 holds for u L and u R .
In this case the inductive assumption tells us that q L = dep. Now the construction of f and A means that q = dep. But this means that u does not provide us with a counterexample. Hence Y i ∩ desc(e L ), and symmetrically Y i ∩ desc(e R ), is independent in M .
Assume that Y i y ∩ U e L is dependent in M y . If u L is not a leaf of T M and e L is not a basepoint edge, then we can apply Lemma 6.9 (i) to the two edges connecting u L to its children. This then implies that Y i y ∩ desc(e L ) is dependent in M , contradicting the conclusion of the previous paragraph. Therefore u L is a leaf or e L is a basepoint edge. In either case, U e L is a singleton set, and this set must contain a loop, as Y i y ∩ U e L is dependent. A basepoint cannot be a loop, so u L is a leaf of T M . Thus U e L = desc(e L ). Now the dependence of Y i y ∩ U e L implies the dependence of Y i ∩ desc(e L ), a contradiction. The claim follows by a symmetrical argument for Y i y ∩ U e R . Claim 6.10.2 and the inductive assumption now mean that q L = q j and q R = q k , for some values of j and k. Let X j and X k stand for Rep e L (q j ) and Rep e R (q k ). Then ( Proof. Assume that is dependent in M y . Then Proposition 2.3 implies that X j ∪X k is dependent in M y . The construction of f and A now means that q = dep. Lemma 6.9 (i) implies that Y i ∩desc(e) is dependent, so u fails to provide a counterexample.
Assume that Y i ∩ desc(e) is dependent in M . As Y i ∩ desc(e L ) and Y i ∩ desc(e R ) are independent by Claim 6.10.2, Lemma 6.9 (ii) implies that Y i y ∩(U e L ∪U e R ) is dependent in M y , contradicting the previous paragraph.
Finally, assume that Y i x ∩ U e is dependent in M x . Then x = y, or else U e is the disjoint union of U e L and U e R , and we have a contradiction to the first paragraph. Hence e is a basepoint edge, meaning that U e is a single element, and this element must be a loop. A basepoint cannot be a loop, so we have a contradiction.
Assume that x = y, so that e, e L , and e R are all edges of T x . In this case U e is the disjoint union of U e L and U e R . Claim 6.10 Rep e (q l ) and Lemma 6.10 holds for u, a contradiction. Now we must assume that y = x, so that e is a basepoint edge. This means that e is incident with a leaf, ϕ x (e α ), in T x , and e α is the parent basepoint of T y . Therefore U e = {e α }, and e α is in Y i x if and only if e α is in cl My ( Y i y ) = cl My (( Y i y ∩ U e L ) ∪ ( Y i y ∩ U e R )).
Note that ( Y i y ∩U e L )∪( Y i y ∩U e R ) is independent in M y , by Claim 6.10.3.
Assume that e α is in Y i x , so that Y i x ∩ U e = U e = {e α }. In this case is dependent in M y . From Proposition 2.3, we have that X j ∪ X k is independent in M y , and equivalent under . Therefore X j ∪ X k ∪ {e α } is also dependent in M y . The construction of the function f now means that q is either q 1 or q 2 . In the first case, U e ≈ Ue ∅. Hence ( Y i x ∩ U e ) ∼ Ue ∅, and as ∅ = Rep e (q 1 ), we see that u satisfies the lemma. Therefore q = q 2 , and Rep e (q 2 ) = U e . In this case Y i x ∩ U e and Rep e (q 2 ) are equal, so ( Y i x ∩ U e ) ∼ Ue Rep e (q 2 ) certainly holds, and we have a contradiction. Now we must assume that e α is not in is independent in M y . Using the arguments from the previous paragraph, we show that X j ∪ X k ∪ {e α } is also independent in M y , so q = q 1 , where Rep e (q 1 ) = ∅. Now ∅ = Y i x ∩ U e , so ( Y i x ∩ U e ) ∼ Ue Rep e (q 1 ) holds, and this contradiction completes the proof of Lemma 6.10.
Now we can prove that (T M , σ M ) is a parse tree for A. Let the left child of the root t be u L , and let the right child be u R . We let e L and e R be the edges joining t to these children. Recall that U e L = {e m,L } and U e R = {e m,R }, and M t is a copy of U 1,2 on the ground set {e m,L , e m,R }. Let Y i be a subset of E, and let q be the state applied to t by the run of A on enc(T M , σ M , ϕ M , {Y i }). We let q L and q R be the states applied to u L and u R .
In the first case, we assume that q = dep, and we aim to show that Y i is dependent. Our construction of the function labelling t means (q L , q R ) either contains the symbol dep, or is (q 2 , q 2 ). If q L = dep, then Y i ∩desc(e m,L ) is dependent in M by Lemma 6.10, and hence Y i is dependent in M . By symmetry, we assume that neither q L nor q R is dep, so (q L , q R ) = (q 2 , q 2 ). From this we see that Rep e L (q 2 ) = U e L = {e m,L }, and moreover ( In the second case, we assume that Y i is dependent in M . If Y i ∩ desc(e L ) is dependent, then q L = dep by Lemma 6.10. In this case, q = dep, which is what we want. Therefore we assume by symmetry that Y i ∩ desc(e L ) and Therefore Y i t = {e m,L , e m,R }. Let x L be the node of T joined to t by e m,L , and define x R similarly. Then e m,L ∈ Y i t implies that e m,L is in Since every node of T other than t corresponds to a matroid with at least three elements, it follows that neither u L nor u R is a leaf in T M . Let e LL and e LR be the edges that join u L to its children: u LL and u LR . Then Y i ∩ desc(e LL ) and Y i ∩ desc(e LR ) are independent in M , as they are subsets of Y i ∩ desc(e L ). Therefore A applies states q j and q k to u LL and u LR . Let X j and X k be Rep e LL (q j ) and Rep e LR (q j ) respectively. Then Because U e L = {e m,L } is certainly not equivalent to ∅ under ∼ Ue L , we see that A applies the state q 2 to u L . By symmetry it applies q 2 to u R . Thus q = f (q 2 , q 2 ) = dep, where f is the function applied to t by σ M .
We have shown that A accepts enc(T M , σ M , ϕ M , {Y i }) if and only if Y i is independent in M , exactly as we wanted.
Reducing to the connected case. Our final task is to show that we can construct a parse tree for M when M is not connected. In the first part of the proof, we have established that there is a fixed-parameter tractable algorithm for constructing a parse tree relative to the automaton A, when M is connected.
We augment A to obtain the automaton A . We add a new character, κ, to the alphabet of A, and we add new states, dep and indep , to its state space. We augment the transition rules so that δ 2 (κ, α, β) is {indep } when both α and β are indep or accepting states of A, and set δ 2 (κ, α, β) to be {dep } otherwise. The accepting states of A are the accepting states of A, along with indep . We can identify the connected components, M 1 , . . . , M n , of M in polynomial time [1]. We assume that n > 1. Each M j is in M, as M is minor-closed, and we can construct a description ∆(M j ) in polynomial time, as ∆ is minor-compatible. Moreover, bw(M j ) ≤ λ [22,Proposition 14.2.3], Therefore we have a fixed-parameter tractable algorithm for constructing the parse trees, (T M j , σ M j ). Now we construct a rooted tree with n leaves, where each non-leaf has a left child and a right child, and we apply the label κ to each non-leaf vertex. We then identify the n leaves with the n roots in T M 1 , . . . , T Mn . Now it is straightforward to verify that A will use A to check independence in each connected component of M , and accept if and only if A accepts in each of those components. Therefore A decides Ind(X i ) for any matroid in M. Thus we have constructed a parse tree for M . This completes the proof of Theorem 6.7. Proposition 6.1 and Theorem 6.7 immediately lead to the following result. Theorem 6.11. Let M be a minor-closed class of matroids with a minorcompatible representation, ∆. Assume that {M ∈ M : M is 3-connected} is efficiently pigeonhole. Let ψ be any sentence in CMS 0 . There is a fixedparameter tractable algorithm which will test whether ψ holds for matroids in M, where the parameter is branch-width.

Decidability and definability
The theorems of Courcelle and Hliněný have as their goal efficient modelchecking: given a sentence and a graph/matroid, we test whether the sentence is satisfied by that object. Decidability is orthogonal to this problem: given a class of objects and a sentence, we want to decide (in finite time, but not necessarily efficiently) if that sentence is a theorem for the class. We say that the CMS 0 theory of M is decidable if there is a Turing Machine which takes as input any sentence in CMS 0 , and after a finite amount of time decides whether or not the sentence is in the theory of M.
The key idea in the forthcoming decidability proofs is that, given a tree automaton, there is a finite procedure which will decide if there is a tree that the automaton will accept. (See, for example, [9, Theorem 3.74].) Lemma 7.2. Let A = (Σ, Q, F, δ 0 , δ 2 ) be a tree automaton. Let Z be a subset of Q, and let q be a state in Q − Z. There is a finite procedure for deciding the following question: does there exist a Σ-tree, (T, σ), with root t such that if r is the run of A on (T, σ), then q ∈ r(t), and r(v) ∩ Z = ∅ for every vertex v of T .
Proof. Note that if r(v) contains q, where v is a non-root vertex, then we may as well consider the subtree of (T, σ) that has v as its root. This means that we lose no generality in searching only for Σ-trees such that q is contained in r(t), but not in r(v) when v is a non-root vertex. Our search will construct the desired tree, T , or establish that it does not exist.
We proceed by induction on |Q − Z|. Assume Q − Z contains only q. If δ 0 (α) = {q} for some α ∈ Σ, then we return YES: we simply consider the Σ-tree consisting of a single leaf labelled with α. If no such α exists, then we return NO. This completes the proof of the base case, so now we make the obvious inductive assumption.
If δ 0 (α) ∩ Z = ∅ and q ∈ δ 0 (α) for some α ∈ Σ, then we can construct the Σ-tree with a single leaf labelled with α, and the answer is YES. Therefore we assume that no such α exists.
We search for tuples (α, q L , q R ) ∈ Σ × Q × Q such that q ∈ δ 2 (α, q L , q R ) and δ 2 (α, q L , q R ) ∩ Z = ∅. If no such tuple exists, then we halt and return NO. Otherwise, for each such tuple, we search for Σ-trees, (T L , σ L ) and (T R , σ R ), with the following properties: If r L and r R are the runs on these trees, then r L (v) ∩ (Z ∪ {q}) = ∅ for each vertex v of T L , and similarly r R (v) ∩ (Z ∪ {q}) = ∅. Furthermore, q L is in r L (t L ), and q R is in r R (t R ), where t L and t R are the roots of T L and T R . By induction, we can construct such trees, if they exist. If they do exist, then we construct T from the disjoint union of T L and T R by adding a root t, and making its children t L and t R . We then apply the label α to t. This justifies returning the answer YES. If we find that no such trees exist for each tuple (α, q L , q R ), then we return NO. Corollary 7.3. Let A = (Σ, Q, F, δ 0 , δ 2 ) be a tree automaton. There is a finite procedure to decide whether there exists a Σ-tree that A accepts.
Proof. We repeatedly apply Lemma 7.2 with Z set to be the empty set, and q set to be a state in F .
When we say that a class of set-systems is definable we mean there is a CMS 0 sentence, τ , such that a set-system satisfies τ if and only if it is in the class. The matroid independence axioms can be stated in CMS 0 . If N is a fixed matroid, there is a CMS 0 sentence that characterises the matroids having a minor isomorphic to N [14, Lemma 5.1]. From this it follows that a minor-closed class of matroids is definable if it has a finite number of excluded minors. There are also definable minor-closed classes that have infinitely many excluded minors (Remark 7.9). The class of K-representable matroids is not definable when K is an infinite field [20]. Proof. Let ψ be an arbitrary sentence in CMS 0 . We wish to decide whether all set-systems in M satisfy ψ. This is equivalent to deciding whether there exists a set-system in M satisfying ¬ψ. Let τ be a CMS 0 sentence such that a set-system belongs to M if and only if it satisfies τ .  Proof. The family of matroids with branch-width at most λ is minor-closed, and it has finitely many excluded minors [13]. Therefore we can let τ be a CMS 0 sentence encoding the independence axioms for matroids, membership of M, and branch-width of at most λ. Thus a set-system satisfies τ if and only if it is in {M ∈ M : bw(M ) ≤ λ}. This class has bounded decomposition-width, so we apply Theorem 7.4.
The resolution of Rota's conjecture [12] means that the class of F-representable matroids is definable when F is a finite field. Corollary 7.5 now implies that the CMS 0 theory of F-representable matroids with branchwidth at most λ is decidable. This was previously proved by Hliněný and Seese [16,Corollary 5.3], who did not rely on Rota's conjecture. Let M be any minor-closed class of F-representable matroids, where F is a finite field. Geelen, Gerards, and Whittle have also announced that M has finitely many excluded minors [12,Theorem 6]. Therefore M is definable, and hence the CMS 0 theory of {M ∈ M : bw(M ) ≤ λ} is decidable, for any positive integer λ.
Let Z be a flat of the matroid M . If the restriction of M to Z contains no coloops, then Z is a cyclic flat. A basis, B, of M is fundamental if B ∩ Z spans Z whenever Z is a cyclic flat. A matroid with a fundamental basis is a fundamental transversal matroid (see [3]). It is an exercise to prove that B is fundamental if and only if x is freely placed in the flat spanned by the fundamental circuit, C(x, B), for every x / ∈ B. This is equivalent to saying that if Z is a cyclic flat containing x, then Z contains C(x, B). This property can clearly be expressed in MS 0 . In [10, Theorem 6.3], we prove that the class of fundamental transversal matroids is pigeonhole. Therefore the CMS 0 theory of fundamental transversal matroids with branch-width at most λ is decidable by Corollary 7.5.
The class of bicircular matroids can be characterised by an MS 0 sentence [11]. The class is also pigeonhole, as we prove in [10,Theorem 8.4], so the CMS 0 theory of bicircular matroids with branch-width at most λ is decidable.  Proof. We let G be a simple graph, and we let m + (G) be the matroid obtained from m(G) by placing a new element parallel to each 'vertex' element v i . It is easy to check that m + (G) is contained in M for every simple graph G. Moreover, we can characterise the matroids that are equal to m + (G) for some graph G in the following way. Let M be a matroid. Then M is equal to m + (G) for some graph G (with at least three vertices) if and only if the following properties hold: (i) r(M ) = 3, (ii) M is loopless, and any rank-1 flat has cardinality one or two, (iii) any rank-2 flat that contains at least three rank-1 flats contains exactly three such flats, one of cardinality one, and two of cardinality two, (iv) if x is an element that is not in a parallel pair, then x is in exactly one rank-2 flat that contains three rank-1 flats. From this it is clear that there is an MS 0 sentence, τ , such that a matroid satisfies τ if and only if it is isomorphic to m + (G) for some simple graph G.
Now we consider the logical language, MS 1 , for graphs. In this language, we can quantify over variables that represent vertices, and variables that represent subsets of vertices. We have a binary predicate that expresses when a vertex is in a set of vertices, and another that expresses when two vertices are adjacent. Let ψ be a sentence in MS 1 . There is a corresponding sentence, ψ , in MS 0 such that a simple graph, G, satisfies ψ if and only if m + (G) satisfies ψ . Let Vert(X) stand for an MS 0 formula expressing the fact that X is a 2-element circuit. To construct ψ , we make the following interpretations: (i) when v is a vertex variable, we replace ∃v with ∃X v Vert(X v )∧, and replace ∀v with ∀X v Vert(X v ) →. (ii) when V is a set variable, we replace ∃V with ∃X(∀X 1 (Sing(X 1 ) ∧ X 1 ⊆ X) → ∃X 2 (X 1 ⊆ X 2 ∧ X 2 ⊆ X ∧ Vert(X 2 ))) ∧ and we replace ∀V with ∀X(∀X 1 (Sing(X 1 ) ∧ X 1 ⊆ X) → ∃X 2 (X 1 ⊆ X 2 ∧ X 2 ⊆ X ∧ Vert(X 2 ))) → (iii) we replace v ∼ v (the adjacency predicate) with an MS 0 formula saying that X v ∪ X v is not a flat. Trahtenbrot's Theorem shows that there is no finite procedure for deciding whether there is a finite structure that satisfies a given first-order sentence. A corollary is that the first-order theory of finite simple graphs is undecidable (see [19,Theorem 6.2.2]). Since any first-order sentence is also a sentence in MS 1 , it follows that the MS 1 theory of finite simple graphs is undecidable. Imagine that the MS 0 theory of M is decidable. Then for any MS 1 sentence, ψ, we could decide if τ → ψ is a theorem for M. This is equivalent to deciding whether ψ is a theorem for all simple graphs, so we have contradicted Trahtenbrot's result.
The argument in [10, Proposition 6.1] shows that the class of (strict) gammoids is closed under principal extensions. The next result follows easily.
Corollary 7.7. Let K be an infinite field. The MS 0 theory of rank-3 K-representable matroids is undecidable. The MS 0 theories of rank-3 cotransversal matroids and gammoids are undecidable. Therefore the MS 0 theory of corank-3 transversal matroids is undecidable.
Corollary 7.7 is complementary to a result by Hliněný and Seese [16,Theorem 7.2], who have shown that the MS 0 theory of spikes is undecidable. Although every spike has branch-width three, spikes have unbounded rank, and are not representable over a common field. Remark 7.8. If L ⊆ L are languages, and a class of objects has an undecidable L theory, then it obviously follows that it has an undecidable L theory. So any class of matroids with an undecidable MS 0 theory has an undecidable CMS 0 theory. 7.2. Definability and pigeonhole classes. We will now show that definability and the pigeonhole property are independent of each other by exhibiting classes that have exactly one of these properties. One case is easy: the class of sparse paving matroids can be defined by insisting that every non-spanning circuit is a hyperplane. But [10, Lemma 4.1] implies this class is not pigeonhole.
For the other case, we consider polygon matroids. Let C n be the rank-3 sparse paving matroid with ground set {e 1 , . . . , e 2n } and non-spanning circuits The polygon matroids form a well-known infinite antichain [22, Example 14.1.2]. Next we consider path matroids. They too are rank-3 sparse paving matroids. The ground set of a path matroid can be ordered e 1 , . . . , e n in such a way that any non-spanning circuit is a set of three consecutive elements in the ordering. Note that the sparse paving property implies that if {e i , e i+1 , e i+2 } is a non-spanning circuit, then {e i+1 , e i+2 , e i+3 } is not. Every rank-3 proper minor of a polygon matroid is a path matroid, and every path matroid is a minor of a polygon matroid. Remark 7.9. Path matroids can be characterised as follows: they are rankthree matroids where every non-spanning circuit contains exactly three elements, and no element is in more than two non-spanning circuits. Moreover, any non-spanning circuit contains an element that is in exactly one non-spanning circuit. Finally, if {u, v, w} is a non-spanning circuit, and w is in exactly one non-spanning circuit, then there is a partition, (U, V ), of E(M ) − w with u ∈ U and v ∈ V , where {u, v, w} is the only non-spanning circuit containing elements of both U and V . This characterisation shows that the class of path matroids is MS 0 -definable. Furthermore, matroids with rank at most two can be characterised by saying that any subset containing three pairwise disjoint singleton sets is dependent. Therefore the minor-closed class consisting of path matroids and all matroids with rank at most two is definable. It has an infinite number of excluded minors, since every polygon matroid is an excluded minor. Proof. It is easy to see that if M is a matroid with rank zero or one, then dw(M ) ≤ 3. Now assume that M is a rank-2 matroid. Let (T, ϕ) be a decomposition of M such that if (U, V ) is a displayed partition, then no more than one parallel class of M intersects both U and V . It is clear that such a decomposition exists. Now we can easily verify that dw(M ) ≤ 5.
Let M be a rank-3 matroid in M. It is easy to see that there is an ordering e 1 , . . . , e n of E(M ) such that for any partition (U, V ) = ({e 1 , . . . , e t }, {e t+1 , . . . , e n }), at most two non-spanning circuits contain elements from both U and V . We let (T, ϕ) be a decomposition that displays only partitions of this type. It is straightforward to verify that this type of decomposition leads to an upper bound on the decomposition-width of all rank-3 matroids in M. Now we can prove the existence of a minor-closed class that is pigeonhole without being definable.
Lemma 7.11. There is a minor-closed class, M, of matroids with the following properties. Each matroid in M has rank (and therefore branch-width) at most three. Furthermore M has bounded decomposition-width, and is therefore pigeonhole. However, M has an undecidable MS 0 theory, so M is not definable.
Proof. We consider the classes consisting of all matroids with rank at most two, all path matroids, and some subset of the polygon matroids. The fact that these classes have bounded decomposition-width follows from Proposition 7.10. The number of such classes is the cardinality of the power set of the natural numbers, so there are uncountably many such classes. Assume that every such class has a decidable theory. There are countably many Turing Machines, so we let M 1 and M 2 be two distinct such classes, such that exactly the same Turing Machine decides the theories of M 1 and M 2 . Therefore M 1 and M 2 satisfy exactly the same MS 0 sentences. Without loss of generality, we can let P be a polygon matroid in M 1 but not in M 2 . It is easy to express the statement 'this matroid is not isomorphic to P ' in MS 0 . This sentence is a theorem for M 2 , but not for M 1 , so we have a contradiction. Therefore there are classes that have undecidable theories. Any class fails to be definable by virtue of Corollary 7.5. The class of lattice path matroids has infinitely many excluded minors [2]. Despite this, we make the following conjecture.
Conjecture 7.13. The class of lattice path matroids can be characterised by a sentence in MS 0 .
We have proved that the class of lattice path matroids is pigeonhole [10, Theorem 7.2], so Conjecture 7.13, along with Corollary 7.5, would imply the decidability of the MS 0 theory of lattice path matroids with bounded branch-width.
The following conjecture would imply that any minor-closed class of H-gain-graphic matroids can be characterised with a sentence in MS 0 , when H is a finite group. Conjecture 7.14. Let H be a finite group, and let M be a minor-closed class of H-gain-graphic matroids. Then M has only finitely many excluded minors.
We also conjecture that the class of H-gain-graphic matroids is (efficiently) pigeonhole ([10, Conjecture 9.3]). This conjecture, combined with Conjecture 7.14, would imply decidability for any minor-closed of H-gaingraphic matroids with bounded branch-width.
DeVos, Funk, and Pivotto have proved that if H is an infinite group, then the class of H-gain-graphic matroids has infinitely many excluded minors [6, Corollary 1.3]. We conjecture a stronger property. It is not too difficult to see that the techniques of [20] settle this conjecture when H contains elements of arbitrarily high order. Thus it is open only in the case that H is an infinite group with finite exponent. An easy example of such a group is the infinite direct product (Z/2Z) Z + , but there exist more sophisticated examples, such as Tarski monster groups.
We also believe the following.
Conjecture 7.16. Let H be an infinite group. The class of rank-3 H-gaingraphic matroids has an undecidable MS 0 theory.