Tree automata and pigeonhole classes of matroids: II

Let $\psi$ be a sentence in the counting monadic second-order logic of matroids and let $\mathbb{F}$ be a finite field. Hlin\v{e}n\'{y}'s Theorem says that we can test whether $\mathbb{F}$-representable matroids satisfy $\psi$ using an algorithm that is fixed-parameter tractable with respect to branch-width. In a previous paper we proved there is a similar fixed-parameter tractable algorithm that can test the members of any efficiently pigeonhole class. In this sequel we apply results from the first paper and thereby extend Hlin\v{e}n\'{y}'s Theorem to the classes of fundamental transversal matroids, lattice path matroids, bicircular matroids, and $H$-gain-graphic matroids, when $H$ is a finite group. As a consequence, we can obtain a new proof of Courcelle's Theorem.


Introduction
In the first paper of the series [8], we proved an extension of Hliněný's Theorem [10]. This theorem concerns the counting monadic second-order logic for matroids, CMS 0 . In this language we have variables X 1 , X 2 , X 3 , . . . representing subsets of the ground set of a matroid. We have a binary predicate X i ⊆ X j , which allows us to say when one subset is contained in another. We also have a unary independence predicate Ind(X i ), which returns the value true when the input is an independent subset. We further have predicates that allow us to say that a set has cardinality p modulo q, where p and q are positive integers. Let ψ be a sentence in CMS 0 . Hliněný's Theorem says that there is a fixed-parameter tractable algorithm for testing whether matroids satisfy ψ, as long as the input class consists of matroids representable over a finite field F. A fixed-parameter tractable algorithm typically includes a numerical parameter, λ, and the running time is bounded by O(f (λ)n c ), where n is the size of the input, c is a constant, and f (λ) is a value that depends only on λ. In the case of Hliněný's Theorem, the parameter is the branch-width of the input matroid. Thus the theorem provides us with a polynomial-time algorithm when the input class is restricted to F-representable matroids of bounded branch-width. The main result of [8] extends Hliněný's Theorem. Theorem 1.1. Let M be an efficiently pigeonhole class of matroids. Let ψ be a sentence in CMS 0 . We can test whether matroids in M satisfy ψ using an algorithm that is fixed-parameter tractable with respect to branch-width.
This sequel paper exploits Theorem 1.1 and related ideas to show that there are fixed-parameter tractable algorithms for testing CMS 0 sentences in other natural classes of matroids, beyond finite-field representable matroids. In particular, our main theorem shows that Hliněný's Theorem can be extended as follows.
Theorem 1.2. Let M be any of the following: (i) the class of fundamental transversal matroids, (ii) the class of lattice path matroids, (iii) the class of bicircular matroids, or (iv) the class of H-gain-graphic matroids, where H is a finite group.
Let ψ be a sentence in CMS 0 . We can test whether matroids in M satisfy ψ using an algorithm that is fixed-parameter tractable with respect to branchwidth.
We now explain efficiently pigeonhole matroid classes, along with some other associated concepts. Formal definitions are reserved for Section 3. Imagine that M is a matroid, and that U is a subset of E(M ). We define an equivalence relation on the subsets of U . Let X and X be subsets of U . Assume that X ∪ Z is independent if and only if X ∪ Z is independent, for any subset Z ⊆ E(M ) − U . We think of this as indicating that no subset of E(M ) − U can distinguish between X and X . In this case we write X ∼ U X . We put the elements of E(M ) into correspondence with the leaves of an appropriately chosen subcubic tree. If there are at most q equivalence classes under ∼ U whenever U is a set displayed by an edge of the tree, then the decomposition-width of M is at most q. This notion of decomposition-width is equivalent to that used by Král [14] and by Strozecki [18,19], in the sense that the decomposition-width of a class is bounded under one definition if and only if it is bounded under the other.
A class of matroids with bounded decomposition-width must have bounded branch-width [8,Corollary 2.8]. The converse does not hold (Lemma 4.1). Let M be a class of matroids, and assume that every subclass of M with bounded branch-width also has bounded decomposition-width. Then we say that M is a pigeonhole class of matroids. This is the case if and only if the dual class is pigeonhole ( [8,Corollary 5.3]). The class of F-representable matroids forms a pigeonhole class if and only if F is finite (Theorem 5.1 and Proposition 5.2). Fundamental transversal matroids (Theorem 6.3) and lattice path matroids also form pigeonhole classes (Corollary 7.4).
A stronger property arises quite naturally. Imagine that M is a class of matroids and that M is an arbitrary matroid in M. Assume that whenever U ⊆ E(M ) and λ M (U ) ≤ k, then there are at most π(k) equivalence classes under ∼ U , where π(k) is a value depending only on k. (Recall that λ M (U ) is the connectivity value of U and is defined to be r M (U ) + r M (V ) − r(M ).) In this case we say that M is strongly pigeonhole (Definition 3.4). Every TREE AUTOMATA AND MATROIDS 3 strongly pigeonhole class is pigeonhole [8,Proposition 2.11], but the converse does not hold [8,Remark 2.12]. The class of fundamental transversal matroids is strongly pigeonhole, and so is the class of F-representable matroids when F is finite (Theorem 5.1). We do not know if any of the other classes in Theorem 1.2 are strongly pigeonhole, but we certainly believe this to be the case (Conjectures 9.1 and 9.3). In fact, we make the broad conjecture that the class of matroids that are transversal and cotransversal is a strongly pigeonhole class (Conjecture 9.2). Theorem 1.1 relies on tree automata to test the sentence ψ, as does Hliněný's Theorem. These machines are described in Section 2. In order to construct a parse tree for the machine to process, we require a further strengthening of the pigeonhole property. It is not enough that there is a bound on the number of classes under ∼ U : we must be able to compute this equivalence relation efficiently. In fact, we are happy to compute a refinement of ∼ U , as long as this refinement does not have too many classes. If we are able to do this, then we say that the class is efficiently pigeonhole (see Definition 3.9 for the formal statement). Any efficiently pigeonhole class is also strongly pigeonhole. The class of matroids representable over a finite field (Theorem 5.1) is efficiently pigeonhole, and this leads to a proof of Hliněný's Theorem. The class of fundamental transversal matroids is also efficiently pigeonhole (Theorem 6.3).
In [8,Theorem 6.11] we also proved that there is a fixed-parametertractable algorithm for testing ψ in members of M as long as the 3-connected members of M form an efficiently pigeonhole class and we can efficiently construct descriptions of minors. This result was motivated by the fact that we do not know if bicircular matroids or H-gain-graphic matroids (H finite) form efficiently pigeonhole classes. (We conjecture this is the case in Conjecture 9.3.) We have been able to show that the 3-connected bicircular matroids and the 3-connected H-gain-graphic matroids form efficiently pigeonhole classes (Theorem 8.3). This is then enough to establish cases (iii) and (iv) in Theorem 1.2.
Knowing that we have efficient model-checking for bicircular matroids gives us a new, and quite simple, proof of Courcelle's Theorem (Remark 8.5), which states that there is a fixed-parameter tractable algorithm for testing monadic second-order sentences in graphs, relative to the parameter of treewidth.
As well as proving positive results, we establish some negative propositions. Any class of matroids that contains the rank-3 uniform matroids and is closed under principal extensions is not pigeonhole (Corollary 4.2). Thus matroids representable over a given infinite field form a non-pigeonhole class (Proposition 5.2). The class of transversal matroids is not pigeonhole, (Proposition 6.1) and nor is the class of gammoids (Remark 6.2). A different argument shows that the class of H-gain-graphic matroids is not pigeonhole when H is infinite (Proposition 8.7).
For an introduction to monadic second-order logic and its application to finite structures, see [6] or [7,Chapter 13]. Oxley provides our reference for the basic concepts of matroid theory [16]. We have noted that if M is a matroid and (U, V ) is a partition of E(M ), then the connectivity value of U is λ M (U ) = r M (U ) + r M (V ) − r(M ). A k-separation is a partition, (U, V ), of the ground set such that |U |, |V | ≥ k, and λ M (U ) < k. A matroid is n-connected if it has no k-separations with k < n. A cyclic flat of the matroid M is a flat F such that the restriction M |F has no coloops. When E is a finite set and I is a collection of subsets of E, we refer to the pair (E, I) as a set-system. We say that the members of I are independent sets.

Tree automata
Definition 2.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 (so that T cannot have exactly two vertices). 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 contained 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 2.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. The transition rules, δ 0 and δ 2 , are partial functions from Σ and Σ × Q × Q respectively, into 2 Q , the power set of Q.
Let A = (Σ, Q, F, δ 0 , δ 2 ) be an automaton and let (T, σ) be a Σ-tree with root t. We let r : V (T ) → 2 Q be the function recursively defined as follows: (i) if v is a leaf of T , then r(v) is δ 0 (σ(v)) 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 empty. We say that r is the run of the automaton A on (T, σ). Note that we define a union over an empty collection to be the empty set. We say that A accepts (T, σ) if r(t) contains an accepting state.
Let Σ be a finite alphabet, and let (T, σ) be a Σ-tree. Let ϕ be a bijection from the finite set E into L(T ), and let Y be a subset of E. We construct a Σ∪(Σ×{0, 1})-tree which we denote enc(T, σ, ϕ, Y ). The characters applied to the leaves of this tree will encode the subset Y . If v is a non-leaf vertex of T , then it receives the label σ(v) in enc(T, σ, ϕ, Y ). However, if v is a leaf, then it receives a label (σ(v), s), where s = 1 if ϕ −1 (v) is in Y and otherwise s = 0. Definition 2.3. Let Σ be a finite set and let A be a tree automaton with Σ∪(Σ×{0, 1}) as its 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 M (A, T, σ, ϕ) is the set-system consisting of all subsets of the leaves that are accepted by the automaton. Now let Σ be a finite set, and let A be a tree automaton with alphabet Σ ∪ (Σ × {0, 1}). Let M = (E, I) be a set-system. Assume there is a Σ-tree (T M , σ M ), and a bijection ϕ M : E → L(T M ) having the property that M = M (A, T M , σ M , ϕ M ). In this case we say that (T M , σ M , ϕ M ) is a parse tree for M (relative to the automaton A).
Note that if (T M , σ M , ϕ M ) is a parse tree for M , then we can simulate an independence oracle for M by running A. We simply label each leaf v with , 0) otherwise. By then running A on the resulting tree, and testing to see if it accepts, we can check whether or not Y is in I. This idea is central to the proofs of Hliněný's Theorem and of Theorem 1.1.

Pigeonhole classes
This section states our central definitions: decomposition-width, pigeonhole classes, strongly pigeonhole classes, and efficiently pigeonhole classes. Definition 3.1. 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.
Clearly ∼ U is an equivalence relation on the subsets of U . No member of I is equivalent to a subset not in I. When I is the set of independent sets of a matroid (more generally, when I is closed under subset containment), all dependent subsets of U are equivalent.
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 Thus there are at most λ + 2 equivalence classes, and we will be done if we can show that this equivalence relation refines ∼ U . If |X|, |X | > r M (U ) then both X and X are dependent, and hence they are equivalent under ∼ U . Since M is uniform, any subsets of U with the same cardinality will be equivalent under ∼ U . Therefore we now need only consider the case that |X|, Theorem 1.1 is concerned with matroid algorithms. For the purposes of measuring the efficiency of these algorithms, we restrict our attention to matroid classes where there is a succinct representation, such as graphic matroids or finite-field-representable matroids. If the Turing Machine operates in time bounded by at most p(n) on any input of length n, where p is some polynomial, then it follows that the length of the string ∆(M ) is no more than p(|E(M )|). A graph provides a succinct representation of a graphic matroid, and a matrix provides a succinct representation of a finite-field-representable matroid.
Proposition 3.7. Let ∆ be a succinct representation of M, a class of matroids. For each positive integer λ let M λ be {M ∈ M : bw(M ) ≤ λ}. Let f be a function from positive integers to positive integers. Assume there is an algorithm which when given a positive integer λ will produce a tree automaton A λ in time bounded by f (λ). Assume also there is an algorithm which when given (∆(M ), λ) for M ∈ M λ will produce a parse tree for M relative to A λ in time bounded by f (λ)|∆(M )| c , where c is a constant. Let ψ be a sentence in CMS 0 . We can test whether matroids in M satisfy ψ using an algorithm that is fixed-parameter tractable with respect to branch-width. Furthermore, M is pigeonhole.
Proof. Assume we are given the input (∆(M ), λ), where M is in M λ . We first construct A λ in time bounded by f (λ). Assume that (T M , σ M , ϕ M ) is the parse tree that we construct for M ∈ M λ relative to A λ . This takes time bounded by f (λ)|∆(M )| c . Now [8,Lemma 4.7] tells us that there is a tree automaton A λ,ψ such that A λ,ψ accepts (T M , σ M , ϕ M ) if and only M satisfies ψ. Moreover, the proof of this lemma is constructive, and it tells us how to build A λ,ψ , given A λ . The time taken to build A λ,ψ depends only λ and ψ (which we regard as fixed). Let this time be equal to g ψ (λ).
Applying A λ,ψ to (T M , σ M , ϕ M ) takes time bounded by h ψ (λ)|∆(M )|, for some value h ψ (λ) that depends only on ψ and λ. Now the total process of testing M to see if it satisfies ψ takes time bounded by This establishes the existence of the fixed-parameter tractable algorithm.
The existence of A λ and (T M , σ M , ϕ M ) for any M ∈ M λ means that M λ is automatic (using the language of [8]). Because it is automatic, it has bounded decomposition-width ([8, Lemma 5.1]). So for any positive integer λ, the class M λ has bounded decomposition-width. This is exactly what it means for M to be pigeonhole. In order to construct parse trees for automata to process, we need to be able to efficiently compute the equivalence classes of ∼ U . In fact, we are happy to compute an equivalence relation that refines ∼ U , as long as it does not have too many classes. Definition 3.9. Let M be a class of matroids with a succinct representation ∆. Assume there is a Turing Machine, a constant c, and a function π from positive integers to positive integers such that the machine takes as input any tuple (∆(M ), U, X, X , λ), where M is in M, U ⊆ E(M ) satisfies λ M (U ) ≤ λ, and X and X are subsets of U . Assume also that in time bounded by O(π(λ)|E(M )| c ), the machine computes an equivalence relation, ≈ U , on the subsets of U , so that it accepts (∆(M ), U, X, X , λ) if and only if X ≈ U X . Furthermore we assume that (i) X ≈ U X implies X ∼ U X , and (ii) the number of equivalence classes under ≈ U is at most π(λ).
Under these circumstances, we say that M is efficiently pigeonhole (relative to ∆). Clearly an efficiently pigeonhole class of matroids is also strongly pigeonhole. In Theorem 6.3, we will prove that the class of fundamental transversal matroids is efficiently pigeonhole. Statement (i) of Theorem 1.2 will then immediately follow, by an application of Theorem 1.1.

Non-pigeonhole classes
Next we develop some tools for proving negative results. We want to certify that certain classes are not pigeonhole. Recall that a matroid with rank r is sparse paving if every circuit has cardinality either r or r + 1 and when C and C are distinct circuits of size r then |C ∩ C | < r − 1. Let G be a simple graph with edge set  Proof. Observe that rank-3 matroids have branch-width at most four, so if {M ∈ M : r(M ) = 3} has unbounded decomposition-width, then M is certainly not pigeonhole. Assume for a contradiction that every rank-3 matroid in M has decomposition-width at most K.
Let k be an arbitrary integer greater than K, and let N be an integer such that Assume that there are at least 2k red vertices and at least 2k blue vertices. Then we can assume without loss of generality that there is a matching in G consisting of k red edges, each of which joins a red vertex to a blue vertex. Thus we can find elements v i 1 , . . . , v i k in U e and elements v j 1 , . . . , v j k in V e such that e ipjp is in U e for each p. If p and q are distinct, then {v ip , e ipjp , v jp } is a circuit of M while {v iq , e iqjq , v jp } is a basis. Hence {v ip , e ipjp } and {v iq , e iqjq } are inequivalent under ∼ Ue . This means that ∼ Ue has at least k equivalence classes. As k > K, this is a contradiction, so we assume without loss of generality that there are fewer than 2k red vertices.
Assume some red vertex is joined to at least k blue vertices by red edges. Then there is an element v i ∈ U e and elements v j 1 , . . . , v j k ∈ V e such that e ijp is in U e for each p. For distinct p and q, we see that {v i , e ijp , v jp } is a circuit while {v i , e ijq , v jp } is a basis. Therefore {v i , e ijp } and {v i , e ijq } are inequivalent under ∼ Ue . We again reach the contradiction that there are at least k equivalence classes under ∼ Ue . Now we can deduce that there are fewer than 2k 2 red edges that join a red vertex to a blue vertex.
There are fewer than 2k red vertices and fewer than 2k 2 < 4k 2 red edges that join two red vertices. Since the number of red edges and vertices is at least one third of N + N 2 , we see that the number of red edges joining two blue vertices is at least A result of Abbott, Hanson, and Sauer [1] implies that the subgraph induced by red edges that join two blue vertices contains either a vertex of degree at least k, or a matching containing at least k edges. In the former case, there are elements v i , v j 1 , . . . , v j k ∈ V e such that e ijp is in U e for each p. Then {v i , e ijp , v jp } is a circuit, and {v i , e ijp , v jq } is a basis for distinct p and q, so {v i , v jp } and {v i , v jq } are inequivalent under ∼ Ve . This leads to a contradiction, so there is a matching of at least k edges. Therefore we can we reach a final contradiction that completes the proof.
Let  Proof. We note that m(K N ) can be constructed by starting with a rank-3 uniform matroid, the elements of which represent the vertices of K N . The elements representing edges are then added via principal extensions. The result now follows from Lemma 4.1.

Representable matroids
The next result is not surprising, and is implicitly utilised in the work of Hliněný [10] and Král [14].
Theorem 5.1. Let F be a finite field. The class of F-representable matroids is efficiently pigeonhole.
Proof. Assume that |F| = q. Let M be the class of F-representable matroids. We consider the succinct representation ∆ that sends each matroid in M to an F-matrix representing it. Let M be a rank-r matroid in M, and let U be a subset of M . We use V to denote E(M ) − U . We identify M with a multiset of points in the projective geometry P = PG(r − 1, q) (we lose no generality in assuming that M is loopless). If X is a subset of E(M ), then X will denote its closure in P .
Assume that λ M (U ) ≤ λ. Grassman's identity tells us that the rank of We define the equivalence relation ≈ U so that if X and X are subsets of U , then X ≈ U X if both X and X are dependent, or both are independent and X ∩ V = X ∩ V . Deciding whether X ≈ U X is true requires only elementary linear algebra, and it can certainly be accomplished in time bounded by O(|E(M )| c ) for some constant c. Since U ∩ V is a subspace of P with affine dimension at most λ − 1, it contains at most (q λ − 1)/(q − 1) points. Therefore 2 q λ−1 +q λ−2 +···+1 + 1 is a crude upper bound on the number of (≈ U )-classes. It remains only to show that ≈ U refines ∼ U .
Assume that X ≈ U X , and yet X ∪ Z is independent while X ∪ Z is dependent, where Z is a subset of V . Then X is independent, so X is independent also. Let C be a circuit contained in X ∪ Z. As both X and Z are independent, neither X ∩ C nor Z ∩ C is empty. Now the rank of Assume c is not in X. Since it is in X , we can let C X be a circuit contained in X ∪ c that contains c. If c is in Z, then X ∪ Z contains C X , and we have a contradiction, so c is not in Z. We let C Z be a circuit contained in Z ∪ c that contains c. Circuit elimination between C X and C Z shows that X ∪ Z contains a circuit, and again we have a contradiction. Therefore c is in X. If c is not in Z, then Z ∪ c ⊆ X ∪ Z contains a circuit. Therefore c is in Z. As X and Z are disjoint subsets of E(M ), but c is identified with elements of both, we conclude that M contains a parallel pair, with one element in X, and the other in Z. Again X ∪ Z is dependent, and we have a final contradiction.
Hliněný's Theorem [10] follows immediately from Theorems 1.1 and 5.1. We note that proofs of Hliněný's Theorem can also be derived from the works by Král [14] and Strozecki [19].
Proposition 5.2. Let K be an infinite field. Then the class of K-representable matroids is not pigeonhole.

Fundamental transversal matroids
Transversal matroids can be thought of geometrically as those obtained by placing points freely on the faces of a simplex. A transversal matroid is fundamental if there is a point placed on each vertex of that simplex. More formally, a transversal matroid is fundamental if it has a basis, B, such that r(B ∩ Z) = r(Z), for every cyclic flat Z (see [3]). In this case B is a basis consisting of points located at the vertices of the simplex. From this characterisation it is easy to see that the dual of a fundamental transversal matroid is also fundamental.
In this, and subsequent sections, we will show that three subclasses of transversal matroids are pigeonhole: fundamental transversal matroids (Theorem 6.3), lattice path matroids (Theorem 7.3), and bicircular matroids (Theorem 8.3). To start with, we prove that we cannot extend these results to the entire class of transversal matroids.
Proposition 6.1. The class of transversal matroids is not pigeonhole.
Proof. By Proposition 3.3, we can prove that the class of transversal matroids is not pigeonhole by proving the same statement for the class of cotransversal matroids. Certainly this class contains all rank-3 uniform matroids. Recall that the matroid M is cotransversal if and only if it is a strict gammoid [11]. This means that there is a directed graph G with vertex set E(M ), and a distinguished set, T , of vertices, where X ⊆ E(M ) is independent in M if and only if there are |X| vertex-disjoint directed paths, each of them starting with a vertex in X and terminating with a vertex in T . Assume that G is such a directed graph, and that F is a flat of M . Create the graph G by adding the new vertex e, and arcs directed from e to each of the vertices in F . It is an easy exercise to verify that if M is the strict gammoid corresponding to G , then M is a principal extension of M by F . This demonstrates that the class of cotransversal matroids is closed under principal extensions, so the proposition follows by Corollary 4.2.
Remark 6.2. From Proposition 6.1 we see that any class of matroids containing transversal matroids is not pigeonhole. In particular, the class of gammoids is not pigeonhole.
Let G be a bipartite graph, with bipartition A∪B. There is a fundamental transversal matroid, M [G], with A ∪ B as its ground set, where X ⊆ A ∪ B is independent if and only if there is a matching, W , of G such that |W | = |X ∩ A| and each edge in W joins a vertex in X ∩ A to a vertex in B − X.
In this case we say that W certifies X to be independent. This definition implies that B is a basis of M [G], and r(B ∩ Z) = r(Z) for any cyclic flat Z. Moreover, any fundamental transversal matroid can be represented in this way. Note that we can represent M [G] with a standard bipartite presentation by adding an auxiliary vertex, b , for each vertex b ∈ B, and making b adjacent only to b. We then swap the labels on b and b . The transversal matroid on the ground set A ∪ B represented by this bipartite graph is equal to M [G]. Proof. We consider the succinct representation of fundamental transversal matroids that involves representing such a matroid with a bipartite graph. Let M = M [G] be a fundamental transversal matroid, where A ∪ B is a bipartition of the bipartite graph G, and B is a basis of M . Let (U, V ) be a partition of A ∪ B, and assume that λ M (U ) ≤ λ. Our goal will be to construct an equivalence relation ≈ on the subsets of U such that ≈ satisfies the conditions in Definition 3.9.
Let H be the subgraph of G induced by edges that join vertices in A ∩ U to vertices in B ∩ V , and vertices in A ∩ V to vertices in B ∩ U . Proof. Let W be a matching in H. Let A U and A V , respectively, be the set of vertices in A ∩ U (respectively A ∩ V ) that are incident with an edge in W . Therefore |A U | + |A V | = |W |. If we restrict W to edges incident with vertices in A∩U , then it certifies that (B ∩U )∪A U is an independent subset of U . Similarly, We can find a maximum matching of H, using one of a number of polynomial-time algorithms. It follows from Kőnig's Theorem [13] that H contains a vertex cover, S, such that |S| ≤ λ. Furthermore, Kőnig's Theorem is constructive: given a maximum matching of H, we can find S in polynomial time. From this point onwards, we regard S as being fixed.
Let X be an independent subset of U , and let W be a matching that certifies its independence. We will construct a signature, C(X, W ). Signatures of subsets of V will be defined symmetrically at the same time, so in fact we let {P, Q} be {U, V }, and we let X be an independent subset of P , with W a matching certifying the independence of X. Recall that this means that |W | = |X ∩ A| and each edge of W joins a vertex in X ∩ A to a vertex in B − X.

FUNK, MAYHEW, AND NEWMAN
The signature C(X, W ) is a sequence (S 1 , S 2 , S 3 , S 4 ), where S 1 , S 3 , and S 4 are subsets of B ∩ P ∩ S, A ∩ P ∩ S, and B ∩ Q ∩ S, respectively, and S 2 is a collection of subsets of A ∩ Q ∩ S. We define C(X, W ) as follows.
(i) S 1 is the set of vertices in B ∩ P ∩ S that are either in X or incident with an edge in W . Figure 1. Defining a signature.
We illustrate these definitions in Figure 1. This shows a graph, G, with bipartition A ∪ B, and a partition, (P, Q), of A ∪ B. The edges not in H cross the diagram diagonally, and are drawn with dashed lines, while the unbroken edges are the edges of H. In this example the vertex cover, S, contains nine vertices, which are marked with squares. Observe that every edge of H is incident with a vertex in S. The set X ⊆ P is marked by filled vertices. Its independence is certified by the matching W , which is drawn with heavy lines. Vertices in the sets S 1 , S 3 , and S 4 are marked. The sets in the family S 2 are the empty set and the singleton set containing the vertex marked S 2 . For any independent subset X ⊆ U , let C(X) be the set {C(X, W ) : W is a matching certifying that X is independent}.
Now we define the equivalence relation ≈ U . If X and X are subsets of U , then say that X ≈ U X if both X and X are dependent, or both are independent and C(X) = C(X ). Thus independent sets X and X are equivalent under ≈ U if they have exactly the same signatures.
Now we have established that condition (ii) in Definition 3.9 holds, where the function π(λ) is defined by (1). To complete the proof that the class of fundamental transversal matroids is efficiently pigeonhole, we must establish that we can compute the equivalence relation in time bounded by O(π(λ)|E(M )| c ) and that ≈ U refines ∼ U . Let us first consider the task of Proof. To start with, we check that S 1 contains X ∩ B ∩ P ∩ S and that S 3 is contained in X. If this is not the case, then we halt and return the answer NO, so now we assume that X ∩ B ∩ P ∩ S ⊆ S 1 and S 3 ⊆ X.
Our strategy involves constructing an auxiliary graph, G , by deleting vertices and edges from G. The construction of G is best described by the diagram in Figure 2. Any vertex not shown in this diagram is deleted in the construction of G . Thus from B ∩ P we delete any vertex in X and any vertex in S − S 1 . From A ∩ Q we delete any vertex not in Z. From A ∩ P we delete those vertices not in X. Note that the assumption in the first paragraph of this proof means that we have not deleted any vertex in S 3 . In B ∩ Q, we delete those vertices in S − S 4 . Figure 2. The construction of G .
Next we delete any edge of G that is not represented by an edge in (i) There is a matching, W , of G, such that W certifies the independence of X and C(X, Proof. Assume (i) holds. Then |W | = |X ∩ A|, and every vertex in X ∩ A is incident with an edge of W . Furthermore, every edge of W joins a vertex in . We will show that every edge of W is in G , and hence W is a matching of G . Let ab ∈ W be an edge joining a ∈ A to b ∈ B. Certainly every edge of W − W is an edge of G . Therefore we will assume that ab is in W . Then a is in X, and hence in P . Note that b is not in X, for no edge of W joins two vertices in X. Assume that a is in In the latter case, b is in S 1 by the definition of S 1 . In either case, ab is an edge of G . Now assume b is in Q. Then b must be in S, or else ab is an edge of H not incident with a vertex in S. In this case b is in S 4 by definition, so ab is an edge of G .
Next assume a is in (X ∩ S) − S 3 . Assume b is in P . Then either b is in (B ∩ P ) − (S ∪ X), or it is in S 1 − X. In either case ab is an edge of G . Now assume b is in Q. If b is not in S, then the definition of S 3 implies a ∈ S 3 , since a is in S. But this contradicts the assumption a ∈ (X ∩S)−S 3 . Therefore b is in S. This means b is in S 4 , so ab is an edge of G .
Finally, we assume that a is in S 3 . Then the definition of S 3 means that b is in (B ∩ Q) − S, and again ab is an edge of G . Now we have shown that W is a matching of G . Every vertex in (X ∪ Z) ∩ A is incident with an edge in W , and the same statement is true for vertices in (S 1 − X) ∪ S 4 , by the definitions of S 1 and S 4 . Therefore (ii) holds. Now assume (ii) holds. Let W be a matching of G such that each vertex in (X ∪ Z) ∩ A or (S 1 − X) ∪ S 4 is incident with an edge of W . Let W be the set of edges in W incident with vertices in X ∩ A. There is no vertex in X ∩ B contained in G , so it immediately follows that in G, the matching W certifies the independence of X. Every vertex in S 1 − X is incident with an edge of W , and no vertex of (B ∩ P ∩ S) − S 1 is (since these vertices are not in G). Therefore in C(X, W ), the first entry is S 1 , as desired. Every edge of W − W joins a vertex in Z to a vertex in (B ∩ P ) − (S ∪ X), so W certifies that Z belongs to the second entry of C(X, W ). Because S 3 is a subset of X we see that any vertex in S 3 is matched by W to a vertex in (B ∩ Q) − S. Furthermore no vertex in (X ∩ S ∩ A) − S 3 is, by the construction of G . Therefore the third entry of C(X, W ) is equal to S 3 . Finally, every vertex in S 4 is incident with an edge in W , and no vertex of (B ∩ Q ∩ S) − S 4 is (since these vertices are not in G ). Therefore C(X, W ) = (S 1 , S 2 , S 3 , S 4 ), where Z is in S 2 , so (i) holds. Now we complete the proof of Claim 6.3.2. To test whether W exists, we find a maximum-sized matching of G , using standard methods. If this matching is incident with all the vertices in (X ∪ Z) ∩ A (and is thus complete), then we continue, otherwise we return NO. It is easy to see that we can use alternating-path methods to test whether there is a complete matching that matches all the vertices in (S 1 − X) ∪ S 4 as well as those in (X ∪ Z) ∩ A. We return YES if such a complete matching exists, and NO otherwise, observing that 6.3.2.1 justifies the correctness of this algorithm.
To test whether X ≈ U X , we first test whether X and X are independent. We can certainly test this in polynomial-time via a standard matching algorithm. Assuming both X and X are independent, we simply go through each possible certificate, and check that each certificate belongs to C(X) if and only if it belongs to C(X ). By using Claim 6.3.2, we can accomplish this in time bounded by O(π(λ)|E(M )| c ), for some constant c, where π(λ) is the function in (1). Now our final task in the proof of Theorem 6.3 is to show that ≈ U refines ∼ U . To this end, we assume that X ⊆ U and Y ⊆ V are independent subsets of M . Let S X = (S 1 , S 2 , S 3 , S 4 ) be a signature in C(X), and let T Y = (T 1 , T 2 , T 3 , T 4 ) be a member of C(Y ). Note that S 1 , T 4 ⊆ B ∩ U and S 4 , T 1 ⊆ B ∩ V , while S 2 is a family of subsets of A ∩ V and T 2 is a family of subsets of A ∩ U . We also have S 3 ⊆ A ∩ U and T 3 ⊆ A ∩ V . We declare S X and T Y to be compatible if the following conditions hold: We will prove that X ∪ Y is independent in M if and only if we can find signatures in C(X) and C(Y ) that are compatible. This task is completed in Claim 6.3.3, and its converse (Claim 6.3.4). From this it will easily follow that ≈ U refines ∼ U , and that therefore the class of fundamental transversal matroids is efficiently pigeonhole. Claim 6.3.3. Let X ⊆ U and Y ⊆ V be independent subsets of M . If X ∪Y is independent in M then there are signatures S X ∈ C(X) and T Y ∈ C(Y ) such that S X and T Y are compatible.
Proof. Let W be a matching certifying that X ∪ Y is independent. Thus |W | = |X ∪ Y |, and every edge of W joins a vertex in (X ∪ Y ) ∩ A to a vertex in B − (X ∪ Y ). Let W X and W Y be the subsets of W consisting of edges incident with vertices in X (respectively Y ). Then W X certifies the independence of X, and W Y certifies the independence of Y . We assert that the signatures C(X, W X ) and C(Y, W Y ) are compatible.

FUNK, MAYHEW, AND NEWMAN
Let C(X, W X ) be (S 1 , S 2 , S 3 , S 4 ) and let C(Y, W Y ) be (T 1 , T 2 , T 3 , T 4 ). Then S 1 is the set of vertices in B ∩ U ∩ S that are either in X or incident with an edge of W X . On other hand, T 4 is the set of vertices in B ∩ U ∩ S incident with an edge of W Y . No edge in W Y is incident with an edge in W X , or with a vertex in B ∩ X, so it is clear that S 1 and T 4 are disjoint. Similarly, S 4 is the set of vertices in B ∩ V ∩ S that are incident with an edge of W X and T 1 is the set of vertices in B ∩ V ∩ S that are either in Y , or incident with a vertex in W Y . This implies that S 4 ∩ T 1 = ∅.
Note that T 3 is the set of vertices in A ∩ V ∩ S that are joined by an edge of W Y to a vertex in (B ∩ U ) − S. Let W be the union of W X along with the set of edges in W Y that are incident with a vertex in T 3 . Clearly W is a matching as it is a subset of W . Also, W X ⊆ W and |W − W X | = |T 3 |. Each edge in W − W X is incident with a vertex in T 3 , and with a vertex in We have established that T 3 is contained in S 2 . The symmetrical argument shows that S 3 is in T 2 . Therefore C(X, W X ) and C(Y, W Y ) are compatible, as we claimed. Claim 6.3.4. Let X ⊆ U and Y ⊆ V be independent subsets of M . If there are signatures S X ∈ C(X) and T Y ∈ C(Y ) such that S X and T Y are compatible, then X ∪ Y is independent in M .
Proof. We assume that C(X, W X ) = (S 1 , S 2 , S 3 , S 4 ) and C(Y, W Y ) = (T 1 , T 2 , T 3 , T 4 ) are compatible signatures. Recall that S 1 and T 4 are subsets of B ∩ U and that S 4 and T 1 are subsets of B ∩ V . Furthermore T 3 is a subset of A ∩ V and S 2 is a family of subsets of A ∩ V . Finally, S 3 is a subset of A ∩ U and T 2 is a family of subsets of A ∩ U . We will construct a matching that certifies the independence of X ∪ Y .
Recall that S 3 is the subset of A∩U ∩S containing vertices that are joined by edges of W X to vertices in (B ∩ V ) − S. Let W X be the subset of W X containing edges that are incident with vertices in S 3 . The compatibility of the signatures means that S 3 is in T 2 . Hence there is a matching, Similarly, we let W Y be the subset of W Y containing edges that are incident with vertices in T 3 . Thus each edge in W Y joins a vertex in T 3 to a vertex in (B ∩ U ) − S. As T 3 is in S 2 , we can let W X be a matching such that W X ⊆ W X , |W X − W X | = |T 3 |, and each edge of W X − W X joins a vertex in T 3 to a vertex in (B ∩ U ) − (S ∪ X). We now make the definition We will prove that W is a matching certifying the independence of X ∪ Y .

W is a matching.
Proof. Note that W X − W X and W Y − W Y are certainly matchings. So if W is not matching then there is a vertex w, and distinct edges wx ∈ W X − W X and wy ∈ W Y − W Y .
We first assume that w is in A. Assume also that w is in U . Because Y is a subset of V , no edge of W Y is incident with a vertex in A ∩ U . Therefore wy is in W Y − W Y . This means that wy joins a vertex of S 3 to a vertex in (B ∩ V ) − (S ∪ Y ). In particular this means that w is in S 3 . No edge in W X − W X is incident with a vertex in A ∩ U , so wx is not in W X − W X . Therefore it is in W X , so wx is an edge of W X that is incident with a vertex in S 3 . But this means that wx is in W X , contradicting wx ∈ W X −W X . If w is in V , then we reach the similar contradiction that wy is in W Y . Therefore we must now assume that w is in B.
We assume that w is in B ∩ U . No edge of W Y − W Y is incident with a vertex in B ∩ U . Therefore wy is in W Y , and it follows that y belongs to A ∩ V .
If w is not in S, then y is in S, for otherwise wy is an edge of H that is not incident with the vertex cover S. But in this case, wy joins an edge of A ∩ V ∩ S to a vertex in (B ∩ U ) − S. This implies that y is in T 3 . Now wy belongs to W Y , and we have a contradiction to wy ∈ W Y − W Y . Thus w is in S.
If wx is in W X − W X , then wx joins a vertex in T 3 to a vertex in (B ∩ U ) − (S ∪ X). This is impossible, as we have already confirmed that w is in S. Hence wx is in W X . Now w is in S and is incident with an edge of W X , meaning that it is in S 1 . Furthermore, the edge wy is in W Y , and this means that w is in T 4 . Thus S 1 ∩ T 4 = ∅, and we have a contradiction to the fact that C(X, W X ) and C(Y, W Y ) are compatible.
If w is in V , then we reach the symmetric contradiction that either wx is in W X , or w is in S 4 ∩T 1 . This completes the proof that W is a matching. Now we must demonstrate that the matching W certifies the independence of X ∪ Y . First we show that every edge of W joins a vertex in (X ∪ Y ) ∩ A to a vertex in B − (X ∪ Y ). To this end, we let ab be an edge of W , where a is in A and b is in B. Without loss of generality we can assume that ab is in W X − W X . Then a is either in X or in T 3 , which is a subset of Y . Therefore a is in (X ∪ Y ) ∩ A.
We demonstrate that b is not in X ∪Y . If ab is in W X −W X , then ab joins a vertex in T 3 to a vertex in (B ∩ U ) − (S ∪ X). In this case, b is certainly not in X. Since b is in B ∩ U , and Y ⊆ V , it follows that b is also not in Y . Therefore we will now assume that ab is not in W X − W X , so it is in W X . Each edge of W X joins a vertex of A ∩ X to a vertex of B − X, so b is not in X. Assume that b is in Y , so that it belongs to B ∩ V . Since X ⊆ U , it follows that a is in A ∩ U . If b is not in S, then a is in S, for otherwise ab is an edge of H that is not incident with the vertex cover S. In this case ab is an edge of W X joining a vertex in A ∩ U ∩ S to a vertex in (B ∩ V ) − S, so a is in S 3 , and ab is in W X , a contradiction. Therefore b is in S. As b is in B ∩ Y ∩ S, it follows that it is in T 1 . But the edge ab also certifies that b is in S 4 . Therefore S 4 ∩ T 1 = ∅, and we have a contradiction to the fact that C(X, W X ) and C(Y, W Y ) are compatible. We have shown that b is not in X ∪ Y . Hence every edge of W joins a vertex of A ∩ (X ∪ Y ) to a vertex in B − (X ∪ Y ).
In the final step we must show that every vertex of (X ∪ Y ) ∩ A is incident with an edge in W . Let a be a vertex in (X ∪ Y ) ∩ A. Without loss of generality, we will assume that a is in A ∩ X. Then a is certainly incident with an edge of W X . If it is not incident with an edge of W , then it is not incident with an edge in W X − W X . It follows that in this case, a is incident with an edge of W X . This implies a is in S 3 . But in this case w is incident with an edge of W Y −W Y , and hence with an edge of W . Thus any vertex of A ∩ (X ∪ Y ) is incident with an edge in W , so W certifies the independence of X ∪ Y , exactly as we desired.
Let X and X be two independent subsets of U such that X ≈ U X . Then C(X) = C(X ). Let Y ⊆ V be an independent set such that X ∪ Y is independent. Claim 6.3.3 shows that there are compatible signatures S X ∈ C(X) and T Y ∈ C(Y ). As S X is also in C(X ) it follows from Claim 6.3.4 that X ∪ Y is independent. This implies that X ∼ U X , so ≈ U refines ∼ U , as desired. Now the proof of Theorem 6.3 is complete.
Case (i) in Theorem 1.2 follows immediately from Theorem 6.3 and Theorem 1.1.
Remark 6.4. Theorem 6.3 shows that although a class of matroids may be strongly pigeonhole, its minor-closure may not even be pigeonhole. We can deduce this from Remark 6.2 because the smallest minor-closed class containing the fundamental transversal matroids is the class of gammoids.

Lattice path matroids
The class of lattice path matroids was introduced by Bonin, de Mier, and Noy [2]. It is closed under duality and minors [2, Theorems 3.1 and 3.5]. Every lattice path matroid is transversal. We describe an algorithm that constructs a parse tree for a given lattice path matroid (Theorem 7.3). When combined with Proposition 3.7 this shows that there is a fixed-parameter tractable algorithm for testing CMS 0 sentences in lattice path matroids. It also shows that the class is pigeonhole.
A lattice path matroid is represented by a pair of strings made from the alphabet {E, N }. Let P be such a string, so that P = p 1 p 2 · · · p s , where each p i is equal to either E or N . When i is in {1, . . . , s}, we let n i (P ) stand for the number of N -characters in {p 1 , . . . , p i }. We also let N (P ) stand for {i ∈ {1, . . . , s} : p i = N }. Thus n s (P ) = |N (P )|. If P and Q are strings of s characters from the alphabet {E, N } then we write P Q to mean that n i (P ) ≤ n i (Q) for each i ∈ {1, . . . , s}. Now assume that P and Q each contain r copies of N and m copies of E. Any such string can be identified with a path in the integer lattice from (0, 0) to (m, r) that uses only North and East steps. If P Q then the path P never goes above Q. In this case, an intermediate string, L, is composed of r copies of N and m copies of E and satisfies P L Q. Note that P and Q are both intermediate strings.
Let P and Q be strings composed of r copies of N and m copies of E such that P Q. As we have mentioned, every minor of a lattice path matroid is a lattice path matroid. We now give an explicit description of such minors, following [4, p. 707]. Imagine that M = M [P, Q] is a lattice path matroid, where P and Q contain r copies of N and m copies of E. Let P be p 1 p 2 · · · p m+r and let Q be q 1 q 2 · · · q m+r . Let i be in {1, . . . , m + r}. Assume that n i (P ) = n i (Q). Then i is a coloop of M if p i = q i = N and i is a loop if p i = q i = E. In either of these cases, both M \i and M/i are equal to M [p 1 p 2 · · · p i−1 p i+1 · · · p m+r , q 1 q 2 · · · q i−1 q i+1 · · · q m+r ] after we relabel the elements i + 1, i + 2, . . . , m + r in M \i or M/i as i, i + 1, . . . , m + r − 1.
Now we assume that neither of these scenarios applies. Let j be the largest integer in {1, . . . , i} such that p j = E, and let k be the least integer in {i, . . . , m + r} such that q k = E. Then M \i = M [p 1 p 2 · · · p j−1 p j+1 · · · p m+r , q 1 q 2 · · · q k−1 q k+1 · · · q m+r ], where we apply exactly the same relabelling as before. Next let j be the least integer in {i, . . . , m + r} such that p j = N , and let k be the largest integer in {1, . . . , i} such that q k = N . In this case M/i = M [p 1 p 2 · · · p j−1 p j+1 · · · p m+r , q 1 q 2 · · · q k−1 q k+1 · · · q m+r ]. Proof. Let P be p 1 · · · p m+r and let Q be q 1 · · · q m+r . Assume that the result fails, so that M has no U t,2t -minor. Furthermore assume that M has been chosen subject to this failure so that m + r is as small as possible.
If p 1 = N , then q 1 = N because otherwise P Q fails. In this case M/1 is isomorphic to M [p 2 · · · p m+r , q 2 · · · q m+r ]. But now q 2 , . . . , q i contains at least t more copies of N than p 2 , . . . , p i . Since M/1 has no U t,2t -minor, the minimality of M has been contradicted. Therefore p 1 = E. Symmetrically, if q m+r = N , then p m+r = N or else n m+r−1 (P ) > n m+r−1 (Q). In this case M/(m + r) is isomorphic to M [p 1 · · · p m+r−1 , q 1 · · · q m+r−1 ]. But if i < m + r then the first i characters of p 1 · · · p m+r−1 are the same as the first i characters of p 1 · · · p m+r , and the same applies to q 1 · · · q m+r−1 . If i = m+r, then q 1 · · · q m+r−1 contains at least t more N -characters than p 1 · · · p m+r−1 . In either case we see that M/(m+r) is a smaller counterexample, so q m+r = E.
Let k ∈ {1, . . . , m + r} be the least integer such that q k = E, and let Q = q 1 · · · q k−1 q k+1 · · · q m+r . Let P be p 2 · · · p m+r . Thus M \1 is isomorphic to M [P , Q ]. Now n i−1 (P ) = n i (P ). If k ≤ i, then n i−1 (Q ) = n i (Q), and in this case n i−1 (Q )−n i−1 (P ) ≥ t, so M \1 provides a smaller counterexample. Therefore k > i, which means that q 1 , . . . , q i are all equal to N .
Assume there is at least one N -character in p 1 , . . . , p i . Let j ∈ {1, . . . , i} be the least integer such that p j = N . Let Q = q 2 · · · q m+r and let P be p 1 · · · p j−1 p j+1 · · · p m+r . Thus M/1 is isomorphic to M [P , Q ]. In this case so M/1 is a smaller counterexample. Hence p 1 , . . . , p i are all equal to E.
Note that i ≥ t. Assume that i > t. Then which implies that M \1 is a smaller counterexample. We conclude that Assume that there is an integer j ∈ {i + 1, . . . , m + r} such that p j = E, and let j be the largest such integer. We have noted that q m+r = E. Now we define P to be p 1 · · · p j−1 p j+1 · · · p m+r and Q to be q 1 · · · q m+r−1 . Thus M \(m + r) is isomorphic to M [P , Q ]. But n i (Q ) = n i (Q) = t and n i (P ) = n i (P ) = 0, so we have a smaller counterexample. Therefore p i+1 , . . . , p m+r are all equal to N .
Note that m + r ≥ 2t. Assume that m + r > 2t. Since p 1 , . . . , p i are E-characters and p i+1 , . . . , p m+r are N -characters, and i = t, this means that P and Q contain more than t copies of N . Let k be the largest integer such that q k = N . Since Q contains more than i = t copies of N , we see that k > i. Define Q to be q 1 · · · q k−1 q k+1 · · · q m+r and define P to be p 1 · · · p m+r−1 . Then M/(m + r) is isomorphic to M [P , Q ]. Again we see that n i (Q ) = n i (Q) = t and n i (P ) = n i (P ) = 0. Now we have a smaller counterexample, so m + r = 2t.
We have shown that P consists of t copies of E followed by t copies of N . The first t characters in Q are N , so the following t characters must be E. It is now very easy to see that M is isomorphic to U t,2t , so we have a final contradiction. In the next result, we aim to apply Proposition 3.7 to the class of lattice path matroids. Lattice path matroids are represented succinctly by pairs of strings. Assume that P and Q contain r copies of N and m copies of E. Thus the ground set of M is {1, . . . , m + r}. Let P = p 1 p 2 · · · p m+r and let Q = q 1 q 2 · · · q m+r . Assume that bw(M ) ≤ λ. We construct the tree T M as shown in Figure 3. The bijection ϕ M takes the element i ∈ {1, . . . , m + r} to the leaf v i .  We imagine that Y is a subset of {1, 2, . . . , m + r}. The idea behind the operation of A λ is that it will apply a member of P to each of the internal nodes of T M . The set applied to u i will contain all possible values |N (L i )| − |N (p 1 p 2 · · · p i )|, where L i ranges over all strings of i characters satisfying p 1 p 2 · · · p i L i q 1 q 2 · · · q i and Y ∩ {1, 2, . . . , i} ⊆ N (L i ). Note that Corollary 7.2 implies that such a value can be at most p and that Y is independent in M if and only if the set applied to the root t is non-empty.
To implement this idea, we describe σ M , which applies a function to each node of T M . We say that σ M applies the empty function to any leaf. Next we let g ∈ Σ be the function applied by σ M to u 2 . The domain of g is {0, 1} × {0, 1}. The output of g depends on the characters in p 1 p 2 and q 1 q 2 . In the following table, the columns are labelled by the array Next we let g be the function applied to u i by σ M , where i is in {3, . . . , m + r}.
The domain of g will be P × {0, 1} and the output of g will be in P. Assume that the input to g is (A, s). First consider the case that p i = N . Then To complete the proof of Theorem 7.3, we must show that (T M , σ M , ϕ M ) is a parse tree relative to the automaton A λ . We can accomplish this by proving our claim that the set applied to u i by A λ during its run on enc(T M , σ M , ϕ M , Y ) is the set {|N (L i )| − |N (p 1 p 2 · · · p i )|}, where L i ranges over {E, N } i subject to p 1 p 2 · · · p i L i q 1 q 2 · · · q i and Y ∩ {1, 2, . . . , i} ⊆ N (L i ). When i = 2, this is simply a matter of checking the table above, so we inductively assume the claim is true for i − 1. Let A be the set applied to u i−1 . If p i = N and i is in Y , then the final character in L i must be N , so the set applied to u i should be exactly the numbers in A, as long as those numbers are not greater than n i (Q) − n i (P ). But this set is exactly g (A, 1), where g is the function applied to u i by the labelling σ M . So in this case, the set applied to u i is exactly as we claimed.
If i is not in Y , then the final character in L i could be either E or N , as long as the constraint p 1 p 2 · · · p i L i q 1 q 2 · · · q i is satisfied. Thus the set applied to u i should contain all numbers of the form a−1 or a, where a ranges over the members of A, as long as these numbers are in {0, 1, . . . , n i (Q) − n i (P )}. But this is exactly the output g(A, 0). The case when p i = E yields to exactly the same sort of analysis, so (T M , σ M , ϕ M ) is a parse tree relative to A λ . It is clear that (T M , σ M , ϕ M ) can be constructed in time bounded by f (λ)(m + r) c for some constant c, so the proof is complete.
By applying Proposition 3.7 to the previous result, we see that case (ii) in Theorem 1.2 is proved. Furthermore, we can deduce the following result.
Corollary 7.4. The class of lattice path matroids is pigeonhole.

Frame matroids
Let G be a graph with edge set E. We allow G to contain loops and parallel edges. If X is a subset of E, we use G[X] to denote the subgraph with edge set X containing exactly those vertices that are incident with an edge in X. Similarly, if N is a set of vertices, then G[N ] is the induced subgraph of G with N as its vertex set. A theta subgraph consists of two distinct vertices joined by three internally-disjoint paths. A linear class of cycles in G is a family, B, of cycles such that no theta subgraph of G contains exactly two cycles in B. Let B be a linear class of cycles in G. A cycle in B is balanced, and a cycle not in B is unbalanced. A subgraph of G is unbalanced if it contains an unbalanced cycle, and is otherwise balanced.
Frame matroids were introduced by Zaslavsky [21]. The frame matroid, M (G, B), has E as its ground set. The circuits of M (G, B) are the edge sets of balanced cycles, and the edge sets of minimal connected subgraphs containing at least two unbalanced cycles, and no balanced cycles. Such a subgraph is either a theta subgraph or a handcuff. A tight handcuff contains two edge-disjoint cycles that have exactly one vertex in common. such that X is balanced and contains at least two edges, then X contains at least three vertices of N . If this is not true, then we can easily verify that M has a 1-or 2-separation, contradicting the hypotheses of the theorem. Assume that there are b balanced components of G[U ] with more than one edge, and let α i , . . . , α b be the numbers of vertices these components share with N . Our claim shows that α i ≥ 3 for each i. Finally, assume there are c unbalanced components in G[U ], and these components intersect N in β 1 , . . . , β c vertices, respectively. Thus |N | = 2a+ α i + β i , and r M (U ) = n U − (a + b).
Let x be the number of components of G[V ] consisting of a single non-loop edge. Assume there are y balanced components of G[V ] with more than one edge, and that these intersect N in γ 1 , . . . , γ y vertices. Let z be the number of unbalanced components of G[V ], and assume that they intersect N in δ 1 , . . . , δ z vertices, respectively. So we have |γ i | ≥ 3, |N | = 2x + γ i + δ i , and r M (V ) = n V − (x + y). Because G is connected, r(M ) ≥ n − 1, and r(M ) = n − 1 if and only if G is balanced. Now we observe that This last quantity is equal to a + α i + β i − (b + x + y) + 1, and also to x + γ i + δ i − (a + b + y) + 1, so both are at most λ. By adding the two inequalities together, we obtain But because each α i is at least three, we also have b ≤ 1 3 α i , and symmetrically y ≤ 1 3 γ i . Therefore The edges counted by a form a matching. Therefore they are an independent set in M . As r M (U ) + r M (V ) − r(M ) ≤ λ, submodularity tells us that the intersection of cl M (U ) and cl M (V ) has rank at most λ. Thus there are at least a − λ components of G[U ] that consist of a single, non-loop, edge that is not in cl M (V ). No such edge can be incident with one of the components of G[V ] counted by x, for this would mean that a vertex of G has degree equal to two, implying that M contains a series pair. This is impossible, since M is 3-connected (and we can obviously assume that it has more than three elements). Nor can such an edge join two vertices counted by the variables δ 1 , . . . , δ z , for then the edge joins two components of G[V ] that contain unbalanced cycles. This means that the edge is in a handcuff, and hence in cl M (V ). Now we conclude that each of the (at least) a − λ edges is incident with at least one vertex counted by the variables γ 1 , . . . , γ y . As the edges counted by a form a matching, we now see that a − λ ≤ γ i . We conclude that But (2) implies that 2 α i + 6 β i + 2 γ i ≤ 12λ − 12, and the result follows.
is a 1-separation of M (G, B), but obviously there is no bound on the number of vertices incident with edges in both sides of this separation.
We will concentrate on two subclasses of frame matroids. Bicircular matroids are those frame matroids arising from linear classes that contain only loops. Thus every cycle with more than one edge is unbalanced. For any graph, G, we define B(G) to be the bicircular matroid M (G, ∅). Thus every bicircular matroid is equal to B(G)⊕U 0,t for some graph G and some integer t. Bicircular matroids can also be characterised as the transversal matroids A gain function, σ, takes A(G) to a group H and satisfies σ(e, u, v) = σ(e, v, u) −1 for any non-loop edge e with end-vertices u and v. If W = v 0 e 0 v 1 e 1 · · · e t v t+1 is a walk of G, then the gain-value of W is σ(W ) = σ(e 0 , v 0 , v 1 ) · · · σ(e t , v t , v t+1 ). Now let C = v 0 e 0 v 1 e 1 · · · e t v t+1 be a cycle of G, where v 0 = v t+1 , and the other vertices are pairwise distinct. Note that σ(C) may depend on the choice of orientation of C and if H is nonabelian, it may also depend on the choice of starting vertex. However, if σ(C) is equal to the identity, then this equality will hold no matter which starting vertex and orientation we choose. We declare a cycle to be balanced exactly when σ(C) is equal to the identity, and this gives rise to a linear class. If B is such a linear class, then M (G, B) is an H-gain-graphic matroid. Gain-graphic matroids play an important role in the works by Kahn and Kung [12], and Geelen, Gerards, and Whittle [9].
Let u be a vertex of G, and let α be an element of H. The gain function σ u,α is defined to be identical to σ on any loop and on any edge not incident with u. Furthermore σ u,α (e, u, v) = ασ(e, u, v) when e is a non-loop edge joining u to a vertex v, and in this case σ u,α (e, v, u) is defined to be σ(e, v, u)α −1 . The operation that produces σ u,α from σ is called switching. Two gain functions that are related by switching have exactly the same balanced cycles [20,Lemma 5.2].
The next theorem treats bicircular matroids and gain-graphic matroids simultaneously, since the arguments are essentially identical. Theorem 8.3. The class of 3-connected bicircular matroids is efficiently pigeonhole. If H is a finite group, then the class of 3-connected H-gaingraphic matroids is efficiently pigeonhole.
Proof. Let M be a 3-connected matroid that is either bicircular or H-gaingraphic. If M is bicircular then it is succinctly represented by a description of a graph and a list of the balanced loops. An H-gain-graphic matroid is described via a graph and a labelling that assigns an element of H to each orientation of an edge. Let G be the graph that represents M , so that G is unlabelled if M is bicircular, and labelled if M is H-gain-graphic. We can assume that G has no isolated vertices.
Let (U, V ) be a partition of E such that λ M (U ) ≤ λ for some positive integer λ. Let N be the set of vertices that are in both G[U ] and G[V ], so that |N | ≤ 14λ − 12 by Proposition 8.1. We will describe an equivalence relation ≈ U on the subsets of U and then show that ≈ U can be computed in time bounded by O(π(λ)|E(M )| c ) for some function π and some constant c. Moreover, we will prove that ≈ U satisfies conditions (i) and (ii) of Definition 3.9.
Let X be a subset of U . If M is H-gain-graphic then we can choose a maximal forest of G[X] and then perform switching operations so that every edge in the forest is labelled with the identity of H [20, Lemma 5.3]. If M is bicircular, we choose the maximal forest but we do not need to perform any switchings. Now X is dependent in M if and only if there is an edge not in the spanning forest that receives an identity label, or if there are two distinct edges not in the maximal forest that are in the same component of G[X]. Thus we can test the independence of X in polynomial time.
Let X and X be subsets of U . We consider the circumstances under which we declare X and X to be equivalent under ≈ U . Firstly, if X and X are both dependent, then X ≈ U X . If exactly one of X and X is dependent, then X ≈ U X . Now assume that both X and X are independent. In this case, any component of G[X] or G[X ] contains at most one cycle. Let u and v be vertices in a component of G[X] or G[X ]. Let Γ be this component. We claim there are at most two paths of Γ that join u to v. This is clear if Γ is a tree, so assume that Γ contains exactly one cycle. Let e be an edge of Γ such that Γ\e is a tree. If there are three distinct paths from u to v in Γ, then two of them use e. Now there must be two distinct paths of Γ\e from either u or v to an end-vertex of e. This is impossible so our claim is proved.
Let X and X be the sets of connected components in G[X] and G[X ], respectively, that have non-empty intersection with N . In the case that X and X are both independent, we declare that X ≈ U X if there is a bijection θ : X → X such that the following statements hold for every Γ ∈ X , It is clear that ≈ U is an equivalence relation. Next we count the equivalence classes. Let τ (|N |) be the number of partitions of N where at most one block of the partition is allowed to be empty. We will think of the nonempty blocks in this partition as being the intersections of components of G[X] with N . Thus τ (|N |) counts the number of possible such intersections. Note that τ is a non-decreasing function on the integers.
To choose an equivalence class of ≈ U , we first choose a non-empty collection of pairwise disjoint subsets of N . Since the size of N is at most 14λ−12, we can do this in at most τ (14λ − 12) ways. Next we choose whether each of these components has a cycle or not. The number of components that intersect N is at most 14λ − 12, so we can make this choice in at most 2 14λ−12 ways. Finally, for each pair (u, v) ∈ N × N , we choose at most two gain-values in H for paths from u to v. The number of ways we can make this choice is at most |H| 2(14λ−12) 2 . Thus the number of equivalence classes under ≈ is at most Let this number be denoted by π(λ). Since H is fixed, π(λ) depends only on λ. It is clear that we can test the equivalence X ≈ U X in time bounded by π(λ)|E(M )| c for some constant c. Now we can complete the proof of Theorem 8.3 by showing that ≈ U refines ∼ U .
To this end, assume that X and X are independent subsets of U and that X ≈ U X . Assume that X ∪ Z is dependent for some Z ⊆ V , and let C be a circuit of M contained in X ∪ Z. We will prove that X ∪ Z is also dependent in M and this will complete the proof.
First assume that C is a balanced cycle. If C is a balanced loop, then it is contained in Z, since X is independent. In this case X ∪Z is dependent and we have nothing left to prove. Therefore we assume that C is a balanced cycle with more than one edge, so M is an H-gain-graphic matroid. Now each component of G[X ∩ C] is a path, P , between two vertices of N . We can replace each such P with a path P of G[X ] running between the same vertices. Moreover, since X ≈ X holds, we can choose P so that σ(P ) = σ(P ). When we perform all these substitutions on C we obtain a walk W in G[X ∪ Z], where σ(W ) is the identity of H. It is now easy to prove that G[W ] contains either a balanced cycle, or two distinct cycles. In either case G[X ∪ Z] is dependent in M so we are done. Now we assume that C is a theta subgraph or a handcuff. Let Γ 1 , . . . , Γ n be the connected components of G[X] that contain edges of C. For each i let D i be the set of edges of C contained in Γ i . Note that D 1 , . . . , D n are pairwise disjoint sets of edges. Because X ≈ X we can make a choice of D i , a minimal set of edges in X for each i such that the following conditions hold. ( ] contains a cycle if and only if G[D i ] contains a cycle. Let C 0 be C. For each i let C i be the subgraph obtained from C i−1 by replacing the edges of D i with D i . Thus C n is a subgraph of G[X ∪ Z]. It is clear that each C i is connected. We will show that C n contains at least two cycles, and then we will be done. For any graph, Γ, let ν(Γ) be |E(Γ)| − |V (Γ)|. If Γ is connected, then ν(Γ) ≥ −1. If Γ is connected and contains exactly one cycle, then ν(Γ) = 0. Let (L, R) be a partition of E(Γ), and assume that γ vertices are incident with edges in both L and R. It is easy to confirm that Note that ν(C 0 ) = 1. We assume inductively that ν(C i−1 ) ≥ 1. Note that G[D i ] may not be connected, but G[D i ] is connected. Our choice of D i means that ν(D i ) ≥ ν(D i ). Furthermore, G[D i ] has at least as many vertices in common with G[C i−1 − D i ] as G[D i ] does. It now follows from (3) that ν(C i ) ≥ ν(C i−1 ) ≥ 1. Thus ν(C n ) ≥ 1, and since C n is connected, it follows that C n contains at least two cycles, as required.
Corollary 8.4. Let M be the class of bicircular or H-gain-graphic matroids (with H a finite group). Let ψ be any sentence in CMS 0 . We can test whether matroids in M satisfy ψ using an algorithm that is fixed-parameter tractable with respect to branch-width.
Proof. This will follow immediately from [8, Theorem 6.7] and Theorem 8.3 if we show that the succinct representations of bicircular and H-gain-graphic matroids are minor-compatible. We rely on [20,Corollary 5.5] and [21, Theorem 2.5]. Let M be a bicircular or H-gain-graphic matroid corresponding to the graph G, and let e be an edge of G. Then M \e is bicircular or H-gaingraphic, and corresponds to G\e. (In the case that M is H-gain-graphic, the edge-labels in G\e are inherited from G.) Contraction is somewhat more technical. If e is a non-loop, then we first perform a switching (in the H-gain-graphic case) so that the gain-value on e is the identity. We then simply contract e from G. The resulting labelled graph represents M/e. Now assume e is a loop of G incident with the vertex u. If e is a balanced loop, we simply delete e, so now assume that e is an unbalanced loop. In the H-gain-graphic case, this implies that H is nontrivial. We obtain the graph G by deleting u and replacing each non-loop edge, e , incident with u with a loop incident with the other end-vertex of e . In the H-gain-graphic case, the loop e is labelled with any non-identity element. Any other loops of G that are incident with u are added as balanced loops after contracting e.
It is clear that the operations of deletion and contraction can be performed in polynomial time, so the classes of bicircular and H-gain-graphic matroids have minor-compatible succinct representations as desired.
Corollary 8.4 completes the proof of Theorem 1.2.
Remark 8.5. Hliněný has shown [10, p. 348] that his work provides an alternative proof of Courcelle's Theorem. We can provide a simple new proof by relying on Corollary 8.4 and using bicircular matroids as models for graphs. We now briefly explain this strategy.
Let ψ be a sentence in the counting monadic second-order logic, CMS 2 of graphs. This means that we can quantify over variables representing vertices, edges, sets of vertices and set of edges. We have binary predicates for set membership, and also an incidence predicate, which allows us to express that an edge is incident with a vertex. Furthermore, we have predicates which allow us to assert that a set has cardinality p modulo q, for any appropriate choice of p and q. We need to show that there is a fixed-parameter tractable algorithm for testing ψ in graphs, with respect to the parameter of treewidth.
Let G be a graph, and let G • be the graph obtained from G by adding two loops at every vertex. We need to interpret ψ as a sentence about bicircular matroids of the form B(G • ). We let Vert(X i ) be the CMS 0 formula stating that X i is a 2-element circuit. Similarly, we let Edge(X i ) be a formula expressing that X i is a singleton set not contained in a 2-element circuit. Now we make the following interpretations in ψ: if v is a vertex variable, we replace ∃v with ∃X v Vert(X v ) ∧, and we replace ∀v with ∀X v Vert(X v ) →. We perform a similar replacement for variables representing edges. If V is a variable representing a set of vertices, we replace ∃V with where Sing(X 1 ) is a predicate expressing that X 1 contains exactly one element. There are similar replacements for variables representing sets of edges and for universal quantifiers. Finally, we replace any occurrence of the predicate stating that e is incident with v with a CMS 0 formula saying that there is a 3-element circuit that contains X e and one of the elements in X v . We let ψ be the sentence we obtain by making these substitutions. It is clear that a graph, G, satisfies ψ if and only if B(G • ) satisfies ψ . Therefore Corollary 8.4 implies that there is a fixed-parameter tractable algorithm for testing whether ψ holds in matroids of the form B(G • ), with respect to the parameter of branch-width.
To find the branch-width of a graph with edge set E, we consider a subcubic tree, T , and a bijection from E to the leaves of T . If (U, V ) is a partition of E displayed by an edge, e, of T , then we count the vertices incident with edges in both U and V . This gives us the width of e, and the maximum width of an edge of T is the width of the decomposition. The lowest width across all such decompositions is the branch-width of the graph. It is not difficult to see that the branch-width of the matroid B(G • ) is bounded by a function of the branch-width of the graph G, and similarly the branch-width of G is bounded by a function of the branch-width of B(G • ). But exactly the same relation holds between the branch-width and the tree-width of G [17, (5.1)]. Now it follows that there is a fixed-parameter tractable algorithm for testing whether ψ holds in graphs, where the parameter is tree-width. This proves Courcelle's Theorem [5].
When H is not finite, the class of H-gain-graphic matroids is not even pigeonhole, as we now show. First we require the following proposition. Proposition 8.6. Let H be an infinite group, and let m and n be positive integers. There are disjoint subsets A, B ⊆ H such that |A| = m, |B| = n, and {ab : a ∈ A, b ∈ B} is disjoint from A ∪ B and has cardinality mn.
Proof. Assume that m = 1. Choose B, an arbitrary subset of n elements that does not include the identity. The cancellation rule implies the result if we let A be a singleton set containing an element not in B ∪{b 1 b −1 2 : b 1 , b 2 ∈ B}. The result similarly holds if n = 1. Now we let m and n be chosen so that m + n is as small as possible with respect to the proposition failing. Let A and B be disjoint subsets such that |A | = m − 1, |B| = n, and {ab : (a, b) ∈ A × B} has cardinality (m − 1)n and is disjoint from A and B. We choose an element x not in A ∪B that does not belong to {ab −1 : a ∈ A, b ∈ B}, nor to {b 1 b −1 2 : b 1 , b 2 ∈ B}, nor to {ab 1 b −1 2 : a ∈ A, b 1 , b 2 ∈ B}. Now we simply let A be A ∪ {x}.
Proposition 8.7. Let H be an infinite group. There are rank-3 H-gaingraphic matroids with arbitrarily high decomposition-width. Hence the class of H-gain-graphic matroids is not pigeonhole.
Proof. Assume otherwise, and let K be an integer such that dw(M ) ≤ K whenever M is a rank-3 H-gain-graphic matroid.
Znám proved that if a bipartite graph with n vertices in each side of its bipartition has more than (d − 1) 1/d n 2−1/d + n(d − 1)/2 edges, then it has a subgraph isomorphic to K d,d [22]. Choose an integer d such that d 2 > K. Choose the integer p so that 1 2 Finally, choose the integer q such that q − p ≥ q/2 ≥ p and Using Proposition 8.6, we choose disjoint subsets A = {a 1 , . . . , a q } and B = {b 1 , . . . , b q } of H such that a i b j = a p b q whenever (i, j) = (p, q). Let AB be {a i b j : 1 ≤ i, j ≤ q}. We can also assume that AB is disjoint from A ∪ B. Let G be a graph on vertex set {v 1 , v 2 , v 3 }, where there are q parallel edges between v 1 and v 2 and between v 2 and v 3 , and q 2 parallel edges between v 1 and v 3 . We let σ be the gain function applying the elements in A to the q arcs from v 1 to v 2 , the elements in B to the arcs from v 2 to v 3 , and the elements in AB to those arcs from v 1 to v 3 . We identify these group elements with the ground set of the H-gain-graphic matroid M = M (G, σ). Therefore M is a rank-3 matroid with ground set A ∪ B ∪ AB. Its nonspanning circuits are the 3-element subsets of A, B, or AB, along with any set of the form {a i , b j , a i b j }.
Let (T, ϕ) be a decomposition of M with the property that if U is any displayed set, then ∼ U has at most K equivalence classes. As in the proof of Lemma 4.1, we let e be an edge of T such that each of the displayed sets, U e and V e , contains at least |E(M )|/3 = (q 2 + 2q)/3 elements. We construct a complete bipartite graph with vertex set A ∪ B and edge set AB, where a i b j joins a i to b j . We colour a vertex or edge red if it belongs to U e , and blue otherwise. Without loss of generality, we will assume that at least q/2 ≥ p vertices in A are red.
Assume that B contains at least p blue vertices. We choose p such vertices, and p red vertices from A, and let G be the graph induced by these 2p vertices. There are p 2 edges in G . Assume that at least p 2 /2 of them are red (the case that at least p 2 /2 of them are blue is almost identical). Our choice of p means that G contains a subgraph isomorphic to K d,d consisting of red edges. Thus there are elements a i 1 , . . . , a i d ∈ A ∩ U e and b j 1 , . . . , b j d ∈ B ∩ V e such that every element a ip b jq is in U e . For (l, k) = (p, q), we see that {a i l , a i l b j k } is not equivalent to {a ip , a ip b jq }, since {a i l , a i l b j k , b j k } is a circuit of M , and {a ip , a ip b jq , b j k } is a basis. Therefore ∼ Ue has at least d 2 > K equivalence classes, and we have a contradiction. We must now assume that B contains fewer than p blue vertices, and hence at least q − p ≥ q/2 red vertices. Thus a symmetrical argument shows that A contains fewer than p blue vertices.
We choose q − p red vertices from each of A and B, and let G be the subgraph induced by these vertices. Let g stand for the number of blue edges in G . The number of edges not in G is equal to q 2 − (q − p) 2 = 2pq − p 2 . As there are g blue edges in G , at most 2pq − p 2 blue edges not in G , and fewer than 2p blue vertices, it follows that |V e | < g + 2pq − p 2 + 2p. Since (q 2 + 2q)/3 ≤ |V e |, we deduce that 1 3 (q 2 + 2q) − p(2q − p + 2) < g.
Our choice of q now means that G has a subgraph isomorphic to K d,d consisting of blue edges. Thus we have elements a i 1 , . . . , a i d ∈ A ∩ U e and b j 1 , . . . , b j d ∈ B ∩ U e such that a ip b jq is in V e for each p and q. For (l, k) = (p, q), we see that {a i l , b j k , a i l b j k } is a circuit of M , while {a ip , b jq , a i l b j k } is a basis. This implies there are at least d 2 equivalence classes under ∼ Ue , so we again have a contradiction.

Open problems
We have proved that the class of lattice path matroids is pigeonhole, but we have not yet proved that it is strongly pigeonhole. Nevertheless, we believe this to be the case.
Conjecture 9.1. The class of lattice path matroids is efficiently pigeonhole.
The classes of fundamental transversal matroids and lattice path matroids are both closed under duality ([16, Proposition 11.2.28] and [2, Theorem 3.5]). Thus they belong to the intersection of transversal and cotransversal matroids. We suspect that Theorem 6.3 (and Conjecture 9.1) exemplify a more general result.
Conjecture 9.2. The class of matroids that are both transversal and cotransversal is strongly pigeonhole.
Despite the existence of examples as in Remark 8.2, we firmly believe the next conjecture.
Conjecture 9.3. The class of bicircular matroids is efficiently pigeonhole. Let H be a finite group. The class of H-gain-graphic matroids is efficiently pigeonhole.