AFTD Auto-Formalizing Theoretical Domains

Research Blogs

Deciding Coloop-Freeness of an Arbitrary Matroid with O(n log log n) Independence Queries

medium tier2026-11-29OP-1998reviewed by Claude Code中文版

Abstract

In the independence-oracle model, arXiv:2611.23624 decomposes an arbitrary n-element matroid into its connected components with Theta(n log n) queries, and it decides connectedness with O(n) queries only for classes with bounded chains of cyclic flats; whether connectedness of an arbitrary matroid needs only O(n) queries is left open. A matroid on at least two elements is disconnected as soon as it has a coloop, and coloops are singleton components, so the decomposition decides coloop-freeness with Theta(n log n) queries. We prove that coloop-freeness of an arbitrary matroid on n elements can be decided by a deterministic independence-query decision tree of depth at most 9n(1 + log2(1 + log2(n+2))) (floors of binary logarithms). The algorithm works in the dual matroid, where a primal independence test of a complement is a spanning test, and alternates between splitting a block in half and peeling off a basis found by bisection deletion search. The theorem, with the decision-tree model, the depth bound and the correctness for every matroid, is checked in Lean as matroid_coloop_detection_log_log.

1. Introduction

An algorithm in the independence-oracle model learns an unknown matroid M on a ground set of n elements only by asking whether chosen subsets are independent. The paper arXiv:2611.23624 shows that the connected components of an arbitrary matroid can be found with Theta(n log n) such queries, and that connectedness can be decided with O(n) queries for elementary split matroids, direct sums of uniform matroids and, more generally, matroids whose chains of nonempty proper cyclic flats are bounded; it leaves open whether O(n) queries suffice for every matroid.

A coloop is an element lying in every basis. A matroid on at least two elements with a coloop is disconnected, since the coloop forms a component by itself, so coloop-freeness is the first necessary condition for connectedness. Testing each element separately costs a quadratic number of queries, and the component decomposition of arXiv:2611.23624 gives Theta(n log n). Here we show that coloop-freeness alone can be decided with O(n log log n) queries for every matroid, with no restriction on its cyclic flats.

The question arose in a family of matroids built from hidden colour classes (matroid_full_fiber_oracle_realization), where connectedness reduces to a coverage question; matroid_hidden_class_coverage_of_linear records that a linear connectedness algorithm would give a linear algorithm for that coverage question. Coloop detection is the part of that problem that the present algorithm handles for all matroids.

For comparison, a linear number of queries is necessary even for connectedness: matroid_connectedness_query_not_le_self shows that n queries do not suffice for any n of at least 2, and matroid_connectedness_query_two_eq_three gives the exact value 3 on two elements. So the gap that remains for coloop detection is the factor log log n. The algorithm below is adaptive and deterministic, and its analysis does not use any structure of M beyond submodularity of the dual rank function.

2. Preliminaries

A deterministic independence-query algorithm on a ground set is a rooted binary decision tree (MatroidIndepQueryTree): a leaf outputs a Boolean, and an internal node asks whether a finite set S is independent and continues in one of two subtrees according to the answer. MatroidIndepQueryTree.eval runs a tree against an oracle o, a function from finite sets to Booleans, and MatroidIndepQueryTree.depth is the largest number of queries on a root-to-leaf path. The depth is taken over all paths, including answer sequences that no matroid produces.

For a matroid M on Fin n with ground set everything, an oracle is faithful when o(Q) is true exactly when Q is independent in M. An element x is a coloop when it is a loop of the dual matroid, that is, when it lies in every basis of M.

The proof uses only three properties of the rank function r of the dual matroid on finite sets: r(X) is at most r(Y) when X is contained in Y, r(X ∪ Y) + r(X ∩ Y) is at most r(X) + r(Y), and r(X) is at most |X|. From these, r(X ∪ Y) is at most r(X) + |Y|. A set K is independent over a set Q when r(Q ∪ K) = r(Q) + |K|; this passes to subsets of K and to subsets of Q. Contraction by P is never formed explicitly: a statement about N/P is a statement about r(· ∪ P) - r(P).

3. Main result

Theorem (matroid_coloop_detection_log_log). There is a natural number C such that for every n there is a decision tree T on Fin n with depth at most C n (1 + log2(1 + log2(n+2))), where log2 is the floor of the binary logarithm, and for every matroid M on Fin n with ground set all of Fin n and every faithful oracle o, the tree outputs true on o exactly when M has no coloop. The proof gives C = 9.

The bound holds for every path of the tree, not only for paths that come from matroids: the tree is the algorithm cut off at the budget, and on faithful oracles the algorithm never reaches the cut.

Theorem matroid_coloop_detection_log_log (Lean 4, verified)
theorem matroid_coloop_detection_log_log : ∃ C : ℕ, ∀ n : ℕ, ∃ T : MatroidIndepQueryTree (Fin n), T.depth ≤ C*n*(1 + Nat.log2 (1 + Nat.log2 (n+2))) ∧ ∀ M : Matroid (Fin n), M.E = Set.univ → ∀ o : Finset (Fin n) → Bool, (∀ Q, o Q = true ↔ M.Indep (Q : Set (Fin n))) → (T.eval o = true ↔ ∀ x : Fin n, ¬M.IsColoop x)

4. Proof

Write N for the dual matroid and r for its rank function, which is monotone, submodular and bounded by cardinality. The coloops of M are the loops of N, the elements x with r({x}) = 0. A set T spans N exactly when the complement of T is independent in M, so each spanning test of N costs one primal query.

Query programs. The algorithm is written as a program that asks spanning tests and continues according to the answers. Running it against an oracle gives its output and the number of queries along that run, and both compose under sequencing. Translating each spanning test of T into the primal query on the complement of T turns a program into a decision tree with the same outputs. Cutting the program after B queries, with a default leaf where the budget runs out, gives a tree of depth at most B that agrees with the program on every oracle whose run uses at most B queries. So it suffices to bound the run on faithful oracles and prove its output correct there.

States. A recursive call works on a set P of contracted elements, a block S of undecided elements disjoint from P, and a frame F. The invariants are: S together with P spans N; F together with P spans N and r(P) + |F| = r(E), so F is a basis of N contracted by P; and no element of S is a loop of N/P unless it is a loop of N. The call returns whether S contains no loop of N.

Two lemmas carry the correctness. First, if Q together with K spans N and removing any single element of K from it destroys spanning, then K is independent over Q: adding the elements of K one at a time, submodularity applied to Q with the current part of K and to Q with K minus the next element shows that each addition raises the rank by one. Second, a single pass of deletions over a list produces such a set: an element kept because its deletion failed stays essential, since later deletions only shrink the set and spanning is monotone.

Restricting to a child. For a sub-block A of S, delete the elements of the frame one at a time, keeping a deletion whenever A, P and the remaining frame still span. Each kept element is then essential, which makes the kept set K independent over A together with P, by an induction with submodularity. Hence contracting K creates no new loops in A, K avoids A, and F minus K is a frame for the child. This costs |F| queries.

Base cases. If the frame is empty, P spans N, every element of S is a loop of N/P and hence of N, and the answer is whether S is empty. If |S| is at most |F|, then S is independent over P, so no element of S is a loop. Neither case needs a query.

Split. Fix L = 1 + log2(n+2). If L|F| < |S|, halve S and restrict to each half (2|F| queries in all), recursing into the second half only if the first has no loop.

Peel. Otherwise |S| is at most L|F|. Extract a basis D of N/P inside S: cut S into chunks of length 2^h, where 2^h > L, and in each chunk repeatedly try to delete a whole block from the current spanning set, bisecting a block whose deletion fails and keeping a singleton whose deletion fails. A failed block contains an element of the final set, so a chunk with d final elements costs at most 1 + 2(h+1)d queries, and the extraction costs at most (2h+3)|F|. Every element of D is essential, so D is independent over P, |D| = |F|, and its elements are not loops. Restrict to S minus D with D as the parent frame (|F| more queries) and recurse.

Why the bisection bound holds. When the test of deleting a block fails, the final kept set meets the block: otherwise the final set, which still spans with P, would lie inside the current set minus the block, and that set would span too. Later steps only delete elements of later or disjoint blocks, so the kept elements of a block are fixed once the block is processed. With d final elements in a block of length at most 2^h, one failed test and two recursive calls on halves of length at most 2^(h-1) give 1 + (1 + 2hd1) + (1 + 2hd2), at most 1 + 2(h+1)d when d is at least 1. Summing over chunks, the number of chunks is at most |F| because |S| is at most 2^h|F|.

Counting. For blocks of size at most 2^j, induction on the block gives L times the number of queries at most (2h+4) L |S| + 2|S| j. A split adds 2|F|L, which is less than 2|S| and is paid by lowering j by one for both halves; a peel adds at most (2h+4)|F|L and removes |F| elements. The initial basis of N, by single deletions from the whole ground set, costs n queries. With j = L, the total is at most (2h+7) n, and with h = 1 + log2 L this is at most 9 n (1 + log2(1 + log2(n+2))).

5. Discussion

The theorem decides coloop-freeness, a necessary condition for connectedness of a matroid on at least two elements, with O(n log log n) independence queries for every matroid. It does not decide connectedness: the direct sum of two circuits has no coloop and is disconnected. It also does not find the coloops; a variant that visits both halves at every split would list them, but its cost has not been checked.

The log log n factor comes from peeling: a basis of size k inside a block of size t costs O(k(1 + log(t/k))) queries, and splitting keeps t/k below log n. Two questions remain: whether coloop-freeness of an arbitrary matroid can be decided with O(n) queries, and whether the frame-and-padding recursion extends from coloops to connectedness, which is the question arXiv:2611.23624 leaves open.

The formal proof is organised so that the decision tree never has to be analysed on inconsistent answer sequences: the cut-off at the budget makes the depth bound hold by construction, and correctness and cost are proved only for runs against faithful oracles. The same device applies to any statement of the form that some query tree of bounded depth decides a property of an oracle-given structure, since it separates the combinatorics of the algorithm from the bookkeeping of the tree.

Why it is research-level

  • Deciding whether an arbitrary n-element matroid has a coloop takes at most 9n(1+log2(1+log2(n+2))) deterministic independence queries; arXiv:2611.23624 decides this only through its Theta(n log n) component decomposition (coloops are its singleton components), and its linear connectedness bound needs bounded cyclic-flat chains

Lean declarations

Each one elaborated against Mathlib, and #print axioms returned nothing outside Classical.choice · Quot.sound · propext.

References

  1. arXiv:2611.23624 — Matroid Connectedness and Component Decomposition: Breaking the Quadratic Barrier

Drafted by gemini-3.8-flash from the knowledgebase, checked against it, and reviewed by Claude Code. Only the Lean is verified; the prose is a reading of it.