AFTD Auto-Formalizing Theoretical Domains

matroid_connectedness_query_not_le_two_mul_sub_two

theoremverifiedoriginal

Here matroid_connectedness_query_le n q means: some deterministic independence-query decision tree of depth at most q decides, for every matroid with ground set Fin n, whether it is connected (any two distinct elements lie in a common circuit). Conjecture (from the exact values for n = 2, 3, 4, 5): for every n ≥ 2, deciding connectedness of matroids on n elements needs at least 2n - 1 independence queries, i.e. matroid_connectedness_query_le n (2 * n - 2) fails.

Statement

theorem matroid_connectedness_query_not_le_two_mul_sub_two (n : ℕ) (hn : 2 ≤ n) :
    ¬ matroid_connectedness_query_le n (2 * n - 2)
Related work
Lower bound conjectured for OP-1998 (arXiv:2611.23624 (Matroid Connectedness and Component Decomposition: Breaking the Quadratic Barrier)). Proposition 2 of the paper proves the lower bound n; exhaustive search over all labelled matroids gives the exact values 3, 5, 7, 9 = 2n - 1 for n = 2, 3, 4, 5 (experiments 33679, 33712, 33956).
Verified
28 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 10
  • matroid_connectedness_query_leFor natural numbers n and q, matroid_connectedness_query_le n q is the statement that the deterministic independence-query complexity of…
  • matroid_connectedness_query_not_le_of_sensitiveSensitivity lower bound. Let M be a connected matroid with ground set Fin n and F a family of finite subsets of Fin n such that for every…
  • matroid_indep_query_tree_eval_eq_of_agreeOn an oracle o, an independence-query tree T asks at most depth(T) sets: there is a family L of at most depth(T) finite sets such that…
  • exists_matroid_of_indep_tableA Boolean table o on the subsets of Fin n that is true on the empty set, closed under taking subsets and satisfies the augmentation axiom…
  • not_matroid_connected_of_not_indep_singletonA matroid with a loop e (the set {e} is dependent) and another ground element f ≠ e is not connected.
  • MatroidIndepQueryTree.depthThe depth (height) of an independence-query decision tree on a ground set α, a natural number defined by recursion on the tree: a leaf…
  • MatroidIndepQueryTree.evalThe Boolean output of an independence-query decision tree T on a ground set α when the queries are answered by an oracle o : Finset α →…
  • 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…
  • MatroidIndepQueryTreeA deterministic independence-query algorithm on a ground set α, as a rooted binary decision tree: a leaf leaf b outputs the Boolean b;…
  • MFor a group $G$, $M$ is the set of elements $s \in G \setminus \{1\}$ such that $c_G(x) \le c_G(s)$ for all $x \in G \setminus \{1\}$.

Read back from the Lean

For every natural number $n \ge 2$, there does not exist an independence query tree $T$ over $\mathrm{Fin}\ n$ of depth at most $2n - 2$ that decides whether any matroid on $\mathrm{Fin}\ n$ (with ground set equal to the universal set) is connected. In other words, any query tree deciding matroid connectedness on an $n$-element ground set requires depth strictly greater than $2n - 2$.

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

To decide whether an n-element matroid is connected, an adversary strategy against any decision tree of depth at most 2n - 2 forces all n singletons to be queried (otherwise a matroid with one loop would be indistinguishable from the connected rank-one uniform matroid). The remaining at most n - 2 queries cannot distinguish a 2-partition split matroid from the rank-one uniform matroid, by an algebraic pigeonhole argument.

  1. independence in serialColors automation

    By definition, independence in the pullback matroid unwinds to image inclusion and injectivity.

    line 7

    uses serialColors

        (serialColors D g).Indep I ↔ g '' I ⊆ D ∧ InjOn g I := by simp [serialColors]
  2. the uniform rank-one matroid is connected

    Construct the rank-one uniform matroid where independent sets are singletons and the empty set, and show it is connected since any two distinct points form a circuit.

    lines 12–30

      let M := serialColors Set.univ (fun _ : Fin n => ())
      have hi (I : Set (Fin n)) : M.Indep I ↔ I.Subsingleton := by
        simp [M,serialColors_indep,Set.InjOn,Set.Subsingleton]
      refine ⟨M,rfl,?_,fun Q => (hi _).trans Finset.card_le_one_iff_subsingleton.symm⟩
      intro x _ y _
      by_cases hxy : x = y
      · exact Or.inl hxy
      right
      have hd := M.dep_of_not_indep (D := {x,y})
        (fun h => hxy (((hi _).mp h) (by simp) (by simp))) (subset_univ _)
      obtain ⟨C,hC,hcirc⟩ := hd.exists_isCircuit_subset
      refine ⟨C,hcirc,?_,?_⟩
      · by_contra hx
        apply hcirc.not_indep ((hi _).mpr ((Set.subsingleton_singleton (a := y)).anti ?_))
        exact fun z hz => (hC hz).resolve_left (by rintro rfl; exact hx hz)
      · by_contra hy
        apply hcirc.not_indep ((hi _).mpr ((Set.subsingleton_singleton (a := x)).anti ?_))
        exact fun z hz => (hC hz).resolve_right (by rintro rfl; exact hy hz)
    
  3. a matroid with a single loop is disconnected

    Construct a matroid where element x is a loop and all other sets are independent iff their cardinality is at most 1. This matroid is disconnected because x cannot belong to a circuit with any other element.

    lines 34–55

      classical
      let g (y : Fin n) := decide (y = x)
      let M := serialColors {false} g
      have hi (I : Set (Fin n)) : M.Indep I ↔ x ∉ I ∧ I.Subsingleton := by
        rw [show M.Indep I ↔ _ from serialColors_indep _ _ _]
        constructor
        · rintro ⟨hmap,hinj⟩
          have hx : x ∉ I := fun h => by simpa [g] using hmap (mem_image_of_mem g h)
          refine ⟨hx,fun a ha b hb => hinj ha hb ?_⟩
          simp [g,show a ≠ x from fun e => hx (e ▸ ha),show b ≠ x from fun e => hx (e ▸ hb)]
        · rintro ⟨hx,hs⟩
          exact ⟨fun _ ⟨a,ha,he⟩ => he ▸ (by simp [g,show a ≠ x from fun e => hx (e ▸ ha)]),
            fun _ ha _ hb _ => hs ha hb⟩
      haveI : Nontrivial (Fin n) := Fin.nontrivial_iff_two_le.mpr hn
      obtain ⟨y,hy⟩ := exists_ne x
      refine ⟨M,rfl,not_matroid_connected_of_not_indep_singleton M x y trivial trivial hy.symm
        (by simp [hi]),?_⟩
      intro Q hQ
      rw [hi,Finset.card_le_one_iff_subsingleton]
      refine and_iff_right_of_imp fun hs hx => hQ ?_
      ext y
      exact ⟨fun hy => Finset.mem_singleton.mpr (hs hy hx),fun hy => Finset.mem_singleton.mp hy ▸ hx⟩
  4. a 2-coloring induces a disconnected matroid

    A non-constant boolean function g yields a disconnected matroid where independent sets are those on which g is injective. Since circuits have size 2 with matching colors, elements with different colors cannot share a circuit.

    lines 60–77

      let M := serialColors Set.univ g
      have hi (I : Set (Fin n)) : M.Indep I ↔ InjOn g I :=
        (serialColors_indep _ _ _).trans (and_iff_right (Set.subset_univ _))
      refine ⟨M,rfl,?_,fun _ => hi _⟩
      intro hc
      rcases hc p trivial z trivial with heq | ⟨C,hC,hp,hz⟩
      · exact hn (congrArg g heq)
      have hnI := mt (hi C).mpr hC.not_indep
      change ¬ ∀ ⦃a⦄, a ∈ C → ∀ ⦃b⦄, b ∈ C → g a = g b → a = b at hnI
      push Not at hnI
      obtain ⟨a,ha,b,hb,he,hne⟩ := hnI
      have hpdep := M.dep_of_not_indep (D := {a,b})
        (fun h => hne (((hi _).mp h) (by simp) (by simp) he)) (subset_univ _)
      have hsub : {a,b} ⊆ C := insert_subset ha (singleton_subset_iff.mpr hb)
      have eqC := (Matroid.isCircuit_iff.mp hC).2 hpdep hsub
      have hp' : p ∈ ({a,b} : Set (Fin n)) := eqC.symm ▸ hp
      have hz' : z ∈ ({a,b} : Set (Fin n)) := eqC.symm ▸ hz
      rcases hp' with rfl | rfl <;> rcases hz' with rfl | rfl <;> simp_all
  5. finding a non-constant coloring by the pigeonhole principle

    By mapping boolean assignments to their values at a basepoint and their XOR parity on chosen pairs from each query in F, we obtain a collision since 2^(|F|+1) < 2^n. The difference yields a non-constant coloring constant on pairs.

    lines 83–112

      classical
      haveI : NeZero n := ⟨by omega⟩
      let p : Fin n := 0
      have reps (Q : F) : ∃ a b : Fin n, 1 < Q.1.card → a ∈ Q.1 ∧ b ∈ Q.1 ∧ a ≠ b := by
        by_cases h : 1 < Q.1.card
        · obtain ⟨a,ha,b,hb,hab⟩ := Finset.one_lt_card.mp h
          exact ⟨a,b,fun _ => ⟨ha,hb,hab⟩⟩
        · exact ⟨p,p,fun hh => (h hh).elim⟩
      choose a b hab using reps
      let sig (f : Fin n → Bool) : Bool × (F → Bool) :=
        (f p, fun Q => xor (f (a Q)) (f (b Q)))
      have hnum : Fintype.card (Bool × (F → Bool)) < Fintype.card (Fin n → Bool) := by
        simp only [Fintype.card_prod,Fintype.card_fun,Fintype.card_bool,Fintype.card_fin,
          Fintype.card_coe]
        rw [Nat.mul_comm,← pow_succ]
        exact Nat.pow_lt_pow_right (by decide : 1 < 2) hcount
      obtain ⟨f,h,fne,hs⟩ := Fintype.exists_ne_map_eq_of_card_lt sig hnum
      let g (x : Fin n) := xor (f x) (h x)
      have hp : f p = h p := congrArg Prod.fst hs
      obtain ⟨z,hz⟩ := Function.ne_iff.mp fne
      refine ⟨g,⟨p,z,?_⟩,?_⟩
      · simp [g,hp]; cases h₁ : f z <;> cases h₂ : h z <;> simp_all
      intro Q hQ hc hinj
      let i : F := ⟨Q,hQ⟩
      obtain ⟨ha,hb,hd⟩ := hab i hc
      apply hd (hinj ha hb ?_)
      have eqbits : xor (f (a i)) (f (b i)) = xor (h (a i)) (h (b i)) :=
        congrFun (congrArg Prod.snd hs) i
      change xor (f (a i)) (h (a i)) = xor (f (b i)) (h (b i))
      cases h₁ : f (a i) <;> cases h₂ : f (b i) <;> cases h₃ : h (a i) <;> cases h₄ : h (b i) <;> simp_all
  6. evaluation path and the forbid lemma

    Evaluate the tree on the rank-one uniform matroid to obtain query set L. Any disconnected matroid agreeing on L yields a contradiction.

    lines 116–126

      classical
      rintro ⟨T,hd,hdec⟩
      let o (Q : Finset (Fin n)) := decide (Q.card ≤ 1)
      obtain ⟨M,he,hc,hi⟩ := serialUniform_ready (n := n)
      have hout := (hdec M he o (fun Q => decide_eq_true_iff.trans (hi Q).symm)).mpr hc
      obtain ⟨L,hL,hagree⟩ := matroid_indep_query_tree_eval_eq_of_agree o T
      have forbid (N : Matroid (Fin n)) (hEN : N.E = univ) (hN : ¬matroid_connected N)
          (h : ∀ Q ∈ L, N.Indep (Q : Set (Fin n)) ↔ Q.card ≤ 1) : False := by
        let onew (Q : Finset (Fin n)) := decide (N.Indep (Q : Set (Fin n)))
        apply hN ((hdec N hEN onew (fun Q => decide_eq_true_iff)).mp ?_)
        exact (hagree onew (fun Q hQ => decide_eq_decide.mpr (h Q hQ))).trans hout
  7. all singletons must be queried

    If any singleton were omitted from L, the one-loop matroid would agree with the uniform matroid on L, contradicting forbid. Thus all n singletons are in L.

    lines 127–135

      let singles := Finset.univ.image (fun x : Fin n => ({x} : Finset (Fin n)))
      have hs : singles ⊆ L := by
        intro Q hQ
        obtain ⟨x,_,rfl⟩ := Finset.mem_image.mp hQ
        by_contra hmiss
        obtain ⟨N,hN,hnc,hall⟩ := serialOneLoop hn x
        exact forbid N hN hnc (fun S hS => hall S (fun h => hmiss (h ▸ hS)))
      have hcard : singles.card = n := by simp [singles,Finset.card_image_of_injective _ Finset.singleton_injective]
      have hdif := Finset.card_sdiff_add_card_eq_card hs
  8. completing the lower bound

    The remaining queries L \ singles have size at most n - 2. Applying serial_cut gives a coloring, which via serialSplit gives a disconnected matroid agreeing on all of L, contradiction.

    lines 136–149

      obtain ⟨g,⟨p,z,hpz⟩,hg⟩ := serial_cut hn (L \ singles) (by omega)
      obtain ⟨N,heN,hnc,hiN⟩ := serialSplit hpz
      apply forbid N heN hnc
      intro Q hQ
      rw [hiN]
      constructor
      · intro hinj
        by_contra! hbig
        have hnot : Q ∉ singles := by
          rintro hmem
          obtain ⟨x,_,rfl⟩ := Finset.mem_image.mp hmem
          simp at hbig
        exact hg Q (Finset.mem_sdiff.mpr ⟨hQ,hnot⟩) hbig hinj
      · exact fun hc' _ h₁ _ h₂ _ => Finset.card_le_one_iff.mp hc' h₁ h₂

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 Setprivate def serialColors {α β : Type*} (allowed : Set β) (g : α → β) : Matroid α :=  (Matroid.freeOn allowed).comapOn Set.univ gprivate theorem serialColors_indep {α β : Type*} (D : Set β) (g : α → β) (I : Set α) :    (serialColors D g).Indep I ↔ g '' I ⊆ D ∧ InjOn g I := by simp [serialColors]private theorem serialUniform_ready {n : ℕ} :    ∃ M : Matroid (Fin n), M.E = Set.univ ∧ matroid_connected M ∧      ∀ Q : Finset (Fin n), M.Indep (Q : Set (Fin n)) ↔ Q.card ≤ 1 := by  let M := serialColors Set.univ (fun _ : Fin n => ())  have hi (I : Set (Fin n)) : M.Indep I ↔ I.Subsingleton := by    simp [M,serialColors_indep,Set.InjOn,Set.Subsingleton]  refine ⟨M,rfl,?_,fun Q => (hi _).trans Finset.card_le_one_iff_subsingleton.symm⟩  intro x _ y _  by_cases hxy : x = y  · exact Or.inl hxy  right  have hd := M.dep_of_not_indep (D := {x,y})    (fun h => hxy (((hi _).mp h) (by simp) (by simp))) (subset_univ _)  obtain ⟨C,hC,hcirc⟩ := hd.exists_isCircuit_subset  refine ⟨C,hcirc,?_,?_⟩  · by_contra hx    apply hcirc.not_indep ((hi _).mpr ((Set.subsingleton_singleton (a := y)).anti ?_))    exact fun z hz => (hC hz).resolve_left (by rintro rfl; exact hx hz)  · by_contra hy    apply hcirc.not_indep ((hi _).mpr ((Set.subsingleton_singleton (a := x)).anti ?_))    exact fun z hz => (hC hz).resolve_right (by rintro rfl; exact hy hz)private theorem serialOneLoop {n : ℕ} (hn : 2 ≤ n) (x : Fin n) :    ∃ M : Matroid (Fin n), M.E = Set.univ ∧ ¬ matroid_connected M ∧      ∀ Q : Finset (Fin n), Q ≠ {x} → (M.Indep (Q : Set (Fin n)) ↔ Q.card ≤ 1) := by  classical  let g (y : Fin n) := decide (y = x)  let M := serialColors {false} g  have hi (I : Set (Fin n)) : M.Indep I ↔ x ∉ I ∧ I.Subsingleton := by    rw [show M.Indep I ↔ _ from serialColors_indep _ _ _]    constructor    · rintro ⟨hmap,hinj⟩      have hx : x ∉ I := fun h => by simpa [g] using hmap (mem_image_of_mem g h)      refine ⟨hx,fun a ha b hb => hinj ha hb ?_⟩      simp [g,show a ≠ x from fun e => hx (e ▸ ha),show b ≠ x from fun e => hx (e ▸ hb)]    · rintro ⟨hx,hs⟩      exact ⟨fun _ ⟨a,ha,he⟩ => he ▸ (by simp [g,show a ≠ x from fun e => hx (e ▸ ha)]),        fun _ ha _ hb _ => hs ha hb⟩  haveI : Nontrivial (Fin n) := Fin.nontrivial_iff_two_le.mpr hn  obtain ⟨y,hy⟩ := exists_ne x  refine ⟨M,rfl,not_matroid_connected_of_not_indep_singleton M x y trivial trivial hy.symm    (by simp [hi]),?_⟩  intro Q hQ  rw [hi,Finset.card_le_one_iff_subsingleton]  refine and_iff_right_of_imp fun hs hx => hQ ?_  ext y  exact ⟨fun hy => Finset.mem_singleton.mpr (hs hy hx),fun hy => Finset.mem_singleton.mp hy ▸ hx⟩private theorem serialSplit {n : ℕ} {g : Fin n → Bool} {p z : Fin n} (hn : g p ≠ g z) :    ∃ M : Matroid (Fin n), M.E = Set.univ ∧ ¬ matroid_connected M ∧      ∀ Q : Finset (Fin n), M.Indep (Q : Set (Fin n)) ↔ Set.InjOn g (Q : Set (Fin n)) := by  let M := serialColors Set.univ g  have hi (I : Set (Fin n)) : M.Indep I ↔ InjOn g I :=    (serialColors_indep _ _ _).trans (and_iff_right (Set.subset_univ _))  refine ⟨M,rfl,?_,fun _ => hi _⟩  intro hc  rcases hc p trivial z trivial with heq | ⟨C,hC,hp,hz⟩  · exact hn (congrArg g heq)  have hnI := mt (hi C).mpr hC.not_indep  change ¬ ∀ ⦃a⦄, a ∈ C → ∀ ⦃b⦄, b ∈ C → g a = g b → a = b at hnI  push Not at hnI  obtain ⟨a,ha,b,hb,he,hne⟩ := hnI  have hpdep := M.dep_of_not_indep (D := {a,b})    (fun h => hne (((hi _).mp h) (by simp) (by simp) he)) (subset_univ _)  have hsub : {a,b} ⊆ C := insert_subset ha (singleton_subset_iff.mpr hb)  have eqC := (Matroid.isCircuit_iff.mp hC).2 hpdep hsub  have hp' : p ∈ ({a,b} : Set (Fin n)) := eqC.symm ▸ hp  have hz' : z ∈ ({a,b} : Set (Fin n)) := eqC.symm ▸ hz  rcases hp' with rfl | rfl <;> rcases hz' with rfl | rfl <;> simp_allprivate theorem serial_cut {n : ℕ} (hn : 2 ≤ n) (F : Finset (Finset (Fin n)))    (hcount : F.card+1 < n) :    ∃ g : Fin n → Bool, (∃ x y, g x ≠ g y) ∧      ∀ Q ∈ F, 1 < Q.card → ¬ Set.InjOn g (Q : Set (Fin n)) := by  classical  haveI : NeZero n := ⟨by omega⟩  let p : Fin n := 0  have reps (Q : F) : ∃ a b : Fin n, 1 < Q.1.card → a ∈ Q.1 ∧ b ∈ Q.1 ∧ a ≠ b := by    by_cases h : 1 < Q.1.card    · obtain ⟨a,ha,b,hb,hab⟩ := Finset.one_lt_card.mp h      exact ⟨a,b,fun _ => ⟨ha,hb,hab⟩⟩    · exact ⟨p,p,fun hh => (h hh).elim⟩  choose a b hab using reps  let sig (f : Fin n → Bool) : Bool × (F → Bool) :=    (f p, fun Q => xor (f (a Q)) (f (b Q)))  have hnum : Fintype.card (Bool × (F → Bool)) < Fintype.card (Fin n → Bool) := by    simp only [Fintype.card_prod,Fintype.card_fun,Fintype.card_bool,Fintype.card_fin,      Fintype.card_coe]    rw [Nat.mul_comm,← pow_succ]    exact Nat.pow_lt_pow_right (by decide : 1 < 2) hcount  obtain ⟨f,h,fne,hs⟩ := Fintype.exists_ne_map_eq_of_card_lt sig hnum  let g (x : Fin n) := xor (f x) (h x)  have hp : f p = h p := congrArg Prod.fst hs  obtain ⟨z,hz⟩ := Function.ne_iff.mp fne  refine ⟨g,⟨p,z,?_⟩,?_⟩  · simp [g,hp]; cases h₁ : f z <;> cases h₂ : h z <;> simp_all  intro Q hQ hc hinj  let i : F := ⟨Q,hQ⟩  obtain ⟨ha,hb,hd⟩ := hab i hc  apply hd (hinj ha hb ?_)  have eqbits : xor (f (a i)) (f (b i)) = xor (h (a i)) (h (b i)) :=    congrFun (congrArg Prod.snd hs) i  change xor (f (a i)) (h (a i)) = xor (f (b i)) (h (b i))  cases h₁ : f (a i) <;> cases h₂ : f (b i) <;> cases h₃ : h (a i) <;> cases h₄ : h (b i) <;> simp_alltheorem matroid_connectedness_query_not_le_two_mul_sub_two (n : ℕ) (hn : 2 ≤ n) :    ¬ matroid_connectedness_query_le n (2 * n - 2) := by  classical  rintro ⟨T,hd,hdec⟩  let o (Q : Finset (Fin n)) := decide (Q.card ≤ 1)  obtain ⟨M,he,hc,hi⟩ := serialUniform_ready (n := n)  have hout := (hdec M he o (fun Q => decide_eq_true_iff.trans (hi Q).symm)).mpr hc  obtain ⟨L,hL,hagree⟩ := matroid_indep_query_tree_eval_eq_of_agree o T  have forbid (N : Matroid (Fin n)) (hEN : N.E = univ) (hN : ¬matroid_connected N)      (h : ∀ Q ∈ L, N.Indep (Q : Set (Fin n)) ↔ Q.card ≤ 1) : False := by    let onew (Q : Finset (Fin n)) := decide (N.Indep (Q : Set (Fin n)))    apply hN ((hdec N hEN onew (fun Q => decide_eq_true_iff)).mp ?_)    exact (hagree onew (fun Q hQ => decide_eq_decide.mpr (h Q hQ))).trans hout  let singles := Finset.univ.image (fun x : Fin n => ({x} : Finset (Fin n)))  have hs : singles ⊆ L := by    intro Q hQ    obtain ⟨x,_,rfl⟩ := Finset.mem_image.mp hQ    by_contra hmiss    obtain ⟨N,hN,hnc,hall⟩ := serialOneLoop hn x    exact forbid N hN hnc (fun S hS => hall S (fun h => hmiss (h ▸ hS)))  have hcard : singles.card = n := by simp [singles,Finset.card_image_of_injective _ Finset.singleton_injective]  have hdif := Finset.card_sdiff_add_card_eq_card hs  obtain ⟨g,⟨p,z,hpz⟩,hg⟩ := serial_cut hn (L \ singles) (by omega)  obtain ⟨N,heN,hnc,hiN⟩ := serialSplit hpz  apply forbid N heN hnc  intro Q hQ  rw [hiN]  constructor  · intro hinj    by_contra! hbig    have hnot : Q ∉ singles := by      rintro hmem      obtain ⟨x,_,rfl⟩ := Finset.mem_image.mp hmem      simp at hbig    exact hg Q (Finset.mem_sdiff.mpr ⟨hQ,hnot⟩) hbig hinj  · exact fun hc' _ h₁ _ h₂ _ => Finset.card_le_one_iff.mp hc' h₁ h₂
See it in the graphDiscuss this resultChallenge it