AFTD Auto-Formalizing Theoretical Domains

matroid_nonadaptive_connectedness_iff_all_nonempty_queries

theoremverifiedoriginal

On n labeled elements with n at least two, a fixed family of independence queries determines connectedness for every full-ground matroid if and only if it includes every nonempty subset. Hence the exact deterministic nonadaptive query complexity is two to the nth power minus one.

Statement

theorem matroid_nonadaptive_connectedness_iff_all_nonempty_queries (n : ℕ) (hn : 2 ≤ n) (F : Finset (Finset (Fin n))) :
    (∀ M N : Matroid (Fin n), M.E = Set.univ → N.E = Set.univ →
      (∀ Q ∈ F, M.Indep (Q : Set (Fin n)) ↔ N.Indep (Q : Set (Fin n))) →
      (matroid_connected M ↔ matroid_connected N)) ↔
    ∀ Q : Finset (Fin n), Q.Nonempty → Q ∈ F
Related work
https://arxiv.org/abs/2611.23624, Section 3 and the open deterministic decision question OP-1998. Original fixed-list consequence of the published example, checked in experiment 44335.
Verified
28 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2
  • matroid_single_query_connectedness_witnessFor every nonempty distinguished subset of a ground type with at least two points, there are connected and disconnected full-ground…
  • matroid_connectedA matroid M on a type α is connected if for all elements e and f of its ground set M.E, either e = f or there is a circuit C of M that…

Read back from the Lean

Given a natural number $n$ with $2 \le n$ and a family $F$ of subsets of $\mathrm{Fin}(n)$ (as a Finset of Finsets), the following two conditions are equivalent: 1. For all matroids $M$ and $N$ on the ground set $\mathrm{Fin}(n)$ whose ground sets are the universal set (M.E = Set.univ and N.E = Set.univ), if $M$ and $N$ agree on the independence of all sets in $F$ (that is, for every $Q \in F$, $Q$ is independent in $M$ if and only if $Q$ is independent in $N$), then $M$ is connected if and only if $N$ is connected (via matroid_connected). 2. $F$ contains every nonempty subset of $\mathrm{Fin}(n)$ (for every $Q : \mathrm{Finset}(\mathrm{Fin}(n))$, if $Q$ is nonempty, then $Q \in F$).

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

The proof, explained

The theorem establishes that a fixed set of independence queries determines matroid connectedness on a ground set of size at least two if and only if it contains every nonempty subset. For necessity, if any nonempty query Q were omitted, a witness construction yields a connected matroid and a disconnected matroid that agree on all subsets except Q, contradicting that the queries determine connectedness. For sufficiency, if all nonempty subsets are queried, then two matroids agreeing on the queries agree on all independent sets (as the empty set is always independent), which by matroid extensionality implies the two matroids are identical.

  1. The ground set Fin n has at least two elements, and the equivalence reduces to proving both implications.

    Since 2 ≤ n, the ground set Fin n is nontrivial by Fin.nontrivial_iff_two_le.mpr. We then split the logical equivalence into the forward implication (necessity) and the reverse implication (sufficiency).

    lines 8–10

    uses Fin.nontrivial_iff_two_le.mpr

      classical
      have : Nontrivial (Fin n) := Fin.nontrivial_iff_two_le.mpr hn
      constructor
  2. For the forward direction, assume F determines connectedness and suppose for contradiction that some nonempty subset Q is missing from F.

    We assume the hypothesis that agreement on all queries in F implies agreement on connectedness. To prove that F contains every nonempty query, we fix a nonempty Finset Q and suppose for contradiction that Q ∉ F.

    lines 11–12

      · intro hd Q hQ
        by_contra hmiss
  3. There exist full-ground matroids M and N such that M is connected, N is disconnected, and they have identical independent sets except on Q.

    Applying matroid_single_query_connectedness_witness to the nonempty set Q on the nontrivial ground set Fin n yields two full-ground matroids M and N such that M is connected, N is disconnected, and M and N agree on the independence of all subsets I ≠ Q.

    lines 13–14

    uses matroid_single_query_connectedness_witness

        obtain ⟨M,N,he,he',hc,hc',ho,_⟩ :=
          matroid_single_query_connectedness_witness (Q : Set (Fin n)) (by simpa using hQ)
  4. This contradicts the assumption that F determines connectedness, so Q must belong to F.

    Since Q ∉ F, no query P ∈ F equals Q as a set (by Finset.coe_injective), so M and N agree on all queries in F. By the assumed distinguishing power of F, M and N must have the same connectedness; but M is connected and N is disconnected, a contradiction.

    lines 15–16

    uses Finset.coe_injective

        apply hc'
        exact (hd M N he he' (fun P hP => ho _ (fun e => hmiss (Finset.coe_injective e ▸ hP)))).mp hc
  5. For the reverse direction, assuming F contains all nonempty subsets, it suffices to show that M and N have the same independent sets.

    Assume F contains all nonempty subsets, and let M and N be full-ground matroids agreeing on F. To show they have the same connectedness, it suffices to show M = N. By matroid extensionality (Matroid.ext_indep), since both matroids have the full universe as ground set, they are equal if they have the same independent sets.

    lines 17–20

    uses Matroid.ext_indep

      · intro h M N he he' ho
        suffices hMN : M = N by rw [hMN]
        apply Matroid.ext_indep (he.trans he'.symm)
        intro I _
  6. Any nonempty subset I is independent in M if and only if it is independent in N.

    If I is nonempty, then its finite counterpart belongs to F by hypothesis, so M and N agree on I by the assumption that they agree on all queries in F.

    lines 21–22

        by_cases hI : I.Nonempty
        · simpa using ho I.toFinset (h I.toFinset (by simpa))
  7. The empty set is also independent in M if and only if it is independent in N, concluding the proof.

    If I is not nonempty, then I = ∅ by Set.not_nonempty_iff_eq_empty.mp. By the matroid axioms, the empty set is unconditionally independent in both M and N, so both sides are true.

    line 23

    uses Set.not_nonempty_iff_eq_empty.mp

        · simp [Set.not_nonempty_iff_eq_empty.mp hI]
Fin.nontrivial_iff_two_le.mpr
A finite type Fin n has at least two elements whenever 2 ≤ n.
matroid_single_query_connectedness_witness
For any nonempty subset H of a nontrivial ground set, there exist full-ground matroids M and N such that M is connected, N is disconnected, and their independent sets differ only on H.
Finset.coe_injective
The coercion from finsets to sets is injective: two finsets with identical elements are equal.
Matroid.ext_indep
Two matroids on the same ground set are equal if they have the exact same independent sets.
Set.not_nonempty_iff_eq_empty.mp
A set that is not nonempty is empty.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

open Settheorem matroid_nonadaptive_connectedness_iff_all_nonempty_queries (n : ℕ) (hn : 2 ≤ n) (F : Finset (Finset (Fin n))) :    (∀ M N : Matroid (Fin n), M.E = Set.univ → N.E = Set.univ →      (∀ Q ∈ F, M.Indep (Q : Set (Fin n)) ↔ N.Indep (Q : Set (Fin n))) →      (matroid_connected M ↔ matroid_connected N)) ↔    ∀ Q : Finset (Fin n), Q.Nonempty → Q ∈ F := by  classical  have : Nontrivial (Fin n) := Fin.nontrivial_iff_two_le.mpr hn  constructor  · intro hd Q hQ    by_contra hmiss    obtain ⟨M,N,he,he',hc,hc',ho,_⟩ :=      matroid_single_query_connectedness_witness (Q : Set (Fin n)) (by simpa using hQ)    apply hc'    exact (hd M N he he' (fun P hP => ho _ (fun e => hmiss (Finset.coe_injective e ▸ hP)))).mp hc  · intro h M N he he' ho    suffices hMN : M = N by rw [hMN]    apply Matroid.ext_indep (he.trans he'.symm)    intro I _    by_cases hI : I.Nonempty    · simpa using ho I.toFinset (h I.toFinset (by simpa))    · simp [Set.not_nonempty_iff_eq_empty.mp hI]
See it in the graphDiscuss this resultChallenge it