AFTD Auto-Formalizing Theoretical Domains

matroid_connectedness_query_not_le_self

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). For every n ≥ 2, n independence queries do not suffice to decide connectedness of matroids on n elements: matroid_connectedness_query_le n n fails, i.e. at least n + 1 queries are needed.

Statement

theorem matroid_connectedness_query_not_le_self (n : ℕ) (hn : 2 ≤ n) :
    ¬ matroid_connectedness_query_le n n
Related work
Lower bound for OP-1998 (arXiv:2611.23624 (Matroid Connectedness and Component Decomposition: Breaking the Quadratic Barrier)). Proposition 2 of the paper proves that at least n queries are needed (the rank-1 uniform matroid and its n one-loop neighbours); this is one more, from the n-element circuit.
Verified
22 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 5
  • 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…
  • 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…
  • 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…
  • not_matroid_connected_of_indep_groundA free matroid (its ground set is independent) with two distinct ground elements is not connected.
  • 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

For every natural number $n \ge 2$, there does not exist an independence query tree $T$ over $\mathrm{Fin}(n)$ with depth at most $n$ that correctly decides matroid connectedness for all matroids on $\mathrm{Fin}(n)$ with ground set $\mathrm{Set.univ}$; that is, no such tree of depth at most $n$ satisfies that for every matroid $M$ on $\mathrm{Fin}(n)$ with $M.E = \mathrm{Set.univ}$ and every oracle $o : \mathrm{Finset}(\mathrm{Fin}(n)) \to \mathrm{Bool}$ answering independence queries for $M$ ($o(S) = \mathrm{true} \iff M.\mathrm{Indep}(S)$), $T.\mathrm{eval}(o) = \mathrm{true}$ if and only if $M$ is connected (meaning every pair of distinct elements in $M.E$ share a circuit).

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 proof establishes the lower bound by applying a sensitivity argument against deterministic decision trees (matroid_connectedness_query_not_le_of_sensitive). The base connected matroid is the uniform matroid U_{n-1, n}, whose only dependent set is the entire ground set. We construct a sensitive family F of n + 1 queries consisting of the full ground set and all n subsets of size n - 1. For each query S in F, there is an unconnected matroid agreeing with U_{n-1, n} on all queries except S: flipping the ground set produces the free matroid, while flipping any set of size n - 1 produces a matroid with that single set as its unique circuit. Because |F| = n + 1 > n, any decision tree must make at least n + 1 queries in the worst case.

  1. The predicate |I| ≤ n - 1 defines the independent sets of a matroid U_{n-1, n} on Fin n.

    We define the independence predicate on finsets of Fin n by |I| ≤ n - 1 (mcqnlsUnifIndep). The empty set has cardinality 0 ≤ n - 1 (mcqnlsUnifIndep_empty). Any subset of an independent finset has smaller or equal cardinality, hence is independent (mcqnlsUnifIndep_subset). If |I| < |J| for two independent finsets, Finset.exists_mem_notMem_of_card_lt_card yields an element e ∈ J \ I whose insertion keeps the size at most |J| ≤ n - 1 (mcqnlsUnifIndep_aug). Using IndepMatroid.ofFinset, these axioms construct the uniform matroid U_{n-1, n} (mcqnlsUnif n).

    lines 5–26

    uses Finset.card_insert_of_notMem, Finset.card_le_card, Finset.exists_mem_notMem_of_card_lt_card, IndepMatroid.ofFinset, le_trans, mcqnlsUnifIndep, mcqnlsUnifIndep_aug, mcqnlsUnifIndep_empty, mcqnlsUnifIndep_subset, subset_univ

    lemma mcqnlsUnifIndep_empty (n : ℕ) : mcqnlsUnifIndep n ∅ := by
      simp [mcqnlsUnifIndep]
    
    lemma mcqnlsUnifIndep_subset {n : ℕ} {I J : Finset (Fin n)}
        (hJ : mcqnlsUnifIndep n J) (hIJ : I ⊆ J) : mcqnlsUnifIndep n I := by
      simp only [mcqnlsUnifIndep] at hJ ⊢
      exact le_trans (Finset.card_le_card hIJ) hJ
    
    lemma mcqnlsUnifIndep_aug {n : ℕ} {I J : Finset (Fin n)}
        (hI : mcqnlsUnifIndep n I) (hJ : mcqnlsUnifIndep n J) (hlt : I.card < J.card) :
        ∃ e ∈ J, e ∉ I ∧ mcqnlsUnifIndep n (insert e I) := by
      simp only [mcqnlsUnifIndep] at hI hJ ⊢
      obtain ⟨e, heJ, heI⟩ := Finset.exists_mem_notMem_of_card_lt_card hlt
      exact ⟨e, heJ, heI, by rw [Finset.card_insert_of_notMem heI]; omega⟩
    
    noncomputable def mcqnlsUnif (n : ℕ) : Matroid (Fin n) :=
      (IndepMatroid.ofFinset (E := Set.univ) (mcqnlsUnifIndep n)
        (mcqnlsUnifIndep_empty n)
        (fun _ _ hJ hIJ => mcqnlsUnifIndep_subset hJ hIJ)
        (fun _ _ hI hJ hlt => mcqnlsUnifIndep_aug hI hJ hlt)
        (by intro I _; exact subset_univ (I : Set (Fin n)))).matroid
    
  2. The ground set of U_{n-1, n} is Set.univ, and any set I ⊆ Fin n is independent if and only if I ≠ Set.univ.

    By construction, the ground set of mcqnlsUnif n is Set.univ (mcqnlsUnif_ground). A set I is independent in the matroid iff all its finite subsets have cardinality at most n - 1 (IndepMatroid.ofFinset_indep'). If I = Set.univ, then Finset.univ ⊆ I has cardinality n > n - 1, a contradiction. Conversely, if I ≠ Set.univ, no finite subset J ⊆ I can have cardinality n (since |J| = n would imply J = Finset.univ, forcing Set.univ ⊆ I), so every finite subset has size at most n - 1.

    lines 27–54

    uses Finset.card_le_univ, Finset.coe_univ, Finset.eq_univ_of_card, IndepMatroid.matroid_indep_iff, IndepMatroid.ofFinset_indep', mcqnlsUnif, mcqnlsUnifIndep, subset_antisymm, subset_univ

    lemma mcqnlsUnif_ground (n : ℕ) : (mcqnlsUnif n).E = Set.univ := rfl
    
    lemma mcqnlsUnif_indep_finset {n : ℕ} {I : Finset (Fin n)} :
        (mcqnlsUnif n).Indep (I : Set (Fin n)) ↔ I.card ≤ n - 1 := by
      simp [mcqnlsUnif, mcqnlsUnifIndep]
    
    lemma mcqnlsUnif_indep_iff {n : ℕ} (hn : 1 ≤ n) {I : Set (Fin n)} :
        (mcqnlsUnif n).Indep I ↔ I ≠ Set.univ := by
      rw [mcqnlsUnif, IndepMatroid.matroid_indep_iff, IndepMatroid.ofFinset_indep']
      constructor
      · intro h hI
        subst hI
        have h1 := h Finset.univ (by simp)
        simp only [mcqnlsUnifIndep] at h1
        have h2 : (Finset.univ : Finset (Fin n)).card = n := by simp
        omega
      · intro hI J hJ
        simp only [mcqnlsUnifIndep]
        by_contra hc
        push Not at hc
        have hJn : J.card = n := by
          have hle : J.card ≤ n := by simpa using Finset.card_le_univ J
          omega
        have hJuniv : J = Finset.univ := Finset.eq_univ_of_card J (by simpa using hJn)
        have hsub : (Set.univ : Set (Fin n)) ⊆ I := by
          rw [← Finset.coe_univ, ← hJuniv]; exact hJ
        exact hI (subset_antisymm (subset_univ I) hsub)
    
  3. For n ≥ 2, U_{n-1, n} is connected.

    A matroid is connected if any two distinct elements lie in a common circuit. Here Set.univ is dependent because it is not independent (mcqnlsUnif_indep_iff), and any proper subset D ⊊ Set.univ is independent, so Set.univ is a minimal dependent set, hence a circuit (Matroid.isCircuit_iff). Since Set.univ contains every element of Fin n, every pair of elements shares the circuit Set.univ.

    lines 55–68

    uses Matroid.dep_iff, Matroid.isCircuit_iff, mcqnlsUnif_indep_iff, Or.inr, subset_univ

    lemma mcqnlsUnif_connected {n : ℕ} (hn : 2 ≤ n) : matroid_connected (mcqnlsUnif n) := by
      intro e he f hf
      refine Or.inr ⟨Set.univ, ?_, trivial, trivial⟩
      rw [Matroid.isCircuit_iff]
      constructor
      · rw [Matroid.dep_iff]
        refine ⟨?_, subset_univ _⟩
        intro hI
        exact ((mcqnlsUnif_indep_iff (by omega) (I := Set.univ)).mp hI) rfl
      · intro D hD hDsub
        rw [Matroid.dep_iff] at hD
        by_contra hne
        exact hD.1 ((mcqnlsUnif_indep_iff (by omega) (I := D)).mpr hne)
    
  4. For n ≥ 2 and any element e, the finsets of cardinality at most n - 1 excluding univ.erase e define a matroid.

    For an element e ∈ Fin n, we define mcqnlsExclIndep n e I as |I| ≤ n - 1 with I ≠ univ.erase e. Since |univ.erase e| = n - 1 ≥ 1 for n ≥ 2, the empty set satisfies this condition (mcqnlsExclIndep_empty). The hereditary property holds because any subset I ⊆ J with J independent cannot equal univ.erase e without forcing J = univ.erase e by cardinality (mcqnlsExclIndep_subset). For augmentation, if |I| < |J|, either some element f ∈ J \ I gives insert f I ≠ univ.erase e, or all elements in J \ I complete I to univ.erase e, which forces J ⊆ univ.erase e and |J| = n - 1, contradicting J ≠ univ.erase e (mcqnlsExclIndep_aug). This builds the matroid mcqnlsExcl n hn e via IndepMatroid.ofFinset.

    lines 69–127

    uses Finset.card_erase_of_mem, Finset.card_insert_of_notMem, Finset.card_le_card, Finset.eq_of_subset_of_card_le, Finset.exists_mem_notMem_of_card_lt_card, Finset.mem_insert_of_mem, Finset.mem_insert_self, Finset.mem_univ, IndepMatroid.ofFinset, le_of_eq, le_trans, mcqnlsEraseCard, mcqnlsExclIndep, mcqnlsExclIndep_aug, mcqnlsExclIndep_empty, mcqnlsExclIndep_subset, subset_univ

    def mcqnlsExclIndep (n : ℕ) (e : Fin n) : Finset (Fin n) → Prop :=
      fun I => I.card ≤ n - 1 ∧ I ≠ Finset.univ.erase e
    
    lemma mcqnlsEraseCard {n : ℕ} (e : Fin n) :
        (Finset.univ.erase e : Finset (Fin n)).card = n - 1 := by
      rw [Finset.card_erase_of_mem (Finset.mem_univ e)]; simp
    
    lemma mcqnlsExclIndep_empty {n : ℕ} (hn : 2 ≤ n) (e : Fin n) : mcqnlsExclIndep n e ∅ := by
      refine ⟨by simp [mcqnlsExclIndep], ?_⟩
      intro h
      have hc : (Finset.univ.erase e : Finset (Fin n)).card = 0 := by rw [← h]; simp
      rw [mcqnlsEraseCard] at hc; omega
    
    lemma mcqnlsExclIndep_subset {n : ℕ} {e : Fin n} {I J : Finset (Fin n)}
        (hJ : mcqnlsExclIndep n e J) (hIJ : I ⊆ J) : mcqnlsExclIndep n e I := by
      obtain ⟨hJc, hJne⟩ := hJ
      refine ⟨le_trans (Finset.card_le_card hIJ) hJc, ?_⟩
      intro hI
      apply hJne
      have hbJ : Finset.univ.erase e ⊆ J := hI ▸ hIJ
      have hcJ : J.card ≤ (Finset.univ.erase e : Finset (Fin n)).card := by
        rw [mcqnlsEraseCard]; exact hJc
      exact (Finset.eq_of_subset_of_card_le hbJ hcJ).symm
    
    lemma mcqnlsExclIndep_aug {n : ℕ} {e : Fin n} {I J : Finset (Fin n)}
        (hI : mcqnlsExclIndep n e I) (hJ : mcqnlsExclIndep n e J) (hlt : I.card < J.card) :
        ∃ f ∈ J, f ∉ I ∧ mcqnlsExclIndep n e (insert f I) := by
      obtain ⟨hIc, hIne⟩ := hI
      obtain ⟨hJc, hJne⟩ := hJ
      by_cases h : ∃ f ∈ J, f ∉ I ∧ insert f I ≠ Finset.univ.erase e
      · obtain ⟨f, hfJ, hfI, hfb⟩ := h
        exact ⟨f, hfJ, hfI, by rw [Finset.card_insert_of_notMem hfI]; omega, hfb⟩
      · exfalso
        push Not at h
        obtain ⟨f0, hf0J, hf0I⟩ := Finset.exists_mem_notMem_of_card_lt_card hlt
        have hb0 : insert f0 I = Finset.univ.erase e := h f0 hf0J hf0I
        have hJb : J ⊆ Finset.univ.erase e := by
          intro x hxJ
          by_cases hxI : x ∈ I
          · rw [← hb0]; exact Finset.mem_insert_of_mem hxI
          · rw [← h x hxJ hxI]; exact Finset.mem_insert_self x I
        have hJble : J.card ≤ (Finset.univ.erase e : Finset (Fin n)).card :=
          Finset.card_le_card hJb
        have hcJ : J.card = (Finset.univ.erase e : Finset (Fin n)).card := by
          have hins : (insert f0 I : Finset (Fin n)).card = I.card + 1 :=
            Finset.card_insert_of_notMem hf0I
          rw [hb0] at hins; omega
        exact hJne (Finset.eq_of_subset_of_card_le hJb (le_of_eq hcJ.symm))
    
    noncomputable def mcqnlsExcl (n : ℕ) (hn : 2 ≤ n) (e : Fin n) : Matroid (Fin n) :=
      (IndepMatroid.ofFinset (E := Set.univ) (mcqnlsExclIndep n e)
        (mcqnlsExclIndep_empty hn e)
        (fun _ _ hJ hIJ => mcqnlsExclIndep_subset hJ hIJ)
        (fun _ _ hI hJ hlt => mcqnlsExclIndep_aug hI hJ hlt)
        (by intro I _; exact subset_univ (I : Set (Fin n)))).matroid
    
    lemma mcqnlsExcl_ground {n : ℕ} (hn : 2 ≤ n) (e : Fin n) :
        (mcqnlsExcl n hn e).E = Set.univ := rfl
    
  5. A set is independent in mcqnlsExcl n hn e iff it differs from both Set.univ and univ.erase e, and univ.erase e is the unique circuit.

    By IndepMatroid.ofFinset_indep', a set I is independent iff I ≠ Set.univ and I ≠ univ.erase e (mcqnlsExcl_indep_iff). Thus the dependent sets are precisely Set.univ and univ.erase e. Since univ.erase e is a proper subset of Set.univ, Set.univ is not minimal dependent. Therefore, univ.erase e is the unique minimal dependent set, i.e., the unique circuit (mcqnlsExcl_isCircuit_iff).

    lines 128–216

    uses Finset.card_le_univ, Finset.coe_erase, Finset.coe_univ, Finset.eq_univ_of_card, IndepMatroid.matroid_indep_iff, IndepMatroid.ofFinset_indep', Matroid.dep_iff, Matroid.isCircuit_iff, mcqnlsExcl, mcqnlsExclIndep, mcqnlsExcl_indep_iff, mem_univ, subset_antisymm, subset_univ

    lemma mcqnlsExcl_indep_finset {n : ℕ} (hn : 2 ≤ n) (e : Fin n) {I : Finset (Fin n)} :
        (mcqnlsExcl n hn e).Indep (I : Set (Fin n)) ↔
          I.card ≤ n - 1 ∧ I ≠ Finset.univ.erase e := by
      simp [mcqnlsExcl, mcqnlsExclIndep]
    
    lemma mcqnlsExcl_indep_iff {n : ℕ} (hn : 2 ≤ n) (e : Fin n) {I : Set (Fin n)} :
        (mcqnlsExcl n hn e).Indep I ↔ I ≠ Set.univ ∧ I ≠ (Finset.univ.erase e : Set (Fin n)) := by
      rw [mcqnlsExcl, IndepMatroid.matroid_indep_iff, IndepMatroid.ofFinset_indep']
      constructor
      · intro h
        refine ⟨?_, ?_⟩
        · intro hI
          subst hI
          have h1 := h Finset.univ (by simp)
          simp only [mcqnlsExclIndep] at h1
          have h2 : (Finset.univ : Finset (Fin n)).card = n := by simp
          omega
        · intro hI
          have h1 := h (Finset.univ.erase e) (by rw [hI])
          simp only [mcqnlsExclIndep] at h1
          exact h1.2 rfl
      · intro ⟨hU, hB⟩ J hJ
        constructor
        · by_contra hc
          push Not at hc
          have hJn : J.card = n := by
            have hle : J.card ≤ n := by simpa using Finset.card_le_univ J
            omega
          have hJuniv : J = Finset.univ := Finset.eq_univ_of_card J (by simpa using hJn)
          apply hU
          have hsub : (Set.univ : Set (Fin n)) ⊆ I := by
            rw [← Finset.coe_univ, ← hJuniv]; exact hJ
          exact subset_antisymm (subset_univ I) hsub
        · intro hJb
          apply hB
          have hsub : (Finset.univ.erase e : Set (Fin n)) ⊆ I := by rw [← hJb]; exact hJ
          have hsub' : (Set.univ \ {e} : Set (Fin n)) ⊆ I := by
            rw [Finset.coe_erase, Finset.coe_univ] at hsub; exact hsub
          apply subset_antisymm ?_ hsub
          intro x hx
          rw [Finset.coe_erase, Finset.coe_univ]
          refine ⟨trivial, ?_⟩
          intro hxe
          apply hU
          apply subset_antisymm (subset_univ I)
          intro y _
          by_cases hy : y = e
          · rw [hy]; exact hxe ▸ hx
          · exact hsub' (by simp [hy])
    
    lemma mcqnlsExcl_isCircuit_iff {n : ℕ} (hn : 2 ≤ n) (e : Fin n) {C : Set (Fin n)} :
        (mcqnlsExcl n hn e).IsCircuit C ↔ C = (Finset.univ.erase e : Set (Fin n)) := by
      rw [Matroid.isCircuit_iff]
      constructor
      · rintro ⟨hdep, hmin⟩
        have hcases : C = Set.univ ∨ C = (Finset.univ.erase e : Set (Fin n)) := by
          by_contra hc
          push Not at hc
          exact hdep.1 ((mcqnlsExcl_indep_iff hn e).mpr hc)
        rcases hcases with h | h
        · exfalso
          have hdepb : (mcqnlsExcl n hn e).Dep (Finset.univ.erase e : Set (Fin n)) := by
            rw [Matroid.dep_iff]
            refine ⟨?_, subset_univ _⟩
            intro hind
            exact ((mcqnlsExcl_indep_iff hn e).mp hind).2 rfl
          have hbC : (Finset.univ.erase e : Set (Fin n)) ⊆ C := by rw [h]; exact subset_univ _
          have heq := hmin hdepb hbC
          rw [h] at heq
          have hmem : e ∈ (Finset.univ.erase e : Set (Fin n)) := by
            rw [heq]; exact mem_univ e
          simp at hmem
        · exact h
      · intro hC
        subst hC
        constructor
        · rw [Matroid.dep_iff]
          refine ⟨?_, subset_univ _⟩
          intro hind
          exact ((mcqnlsExcl_indep_iff hn e).mp hind).2 rfl
        · intro D hD hDC
          rw [Matroid.dep_iff] at hD
          by_contra hne
          have hDuniv : D = Set.univ := by
            by_contra hnu
            exact hD.1 ((mcqnlsExcl_indep_iff hn e).mpr ⟨hnu, hne⟩)
          rw [hDuniv] at hDC
          exact absurd (hDC (mem_univ e)) (by simp)
    
  6. For n ≥ 2, neither mcqnlsExcl n hn e nor the free matroid on Fin n is connected.

    For mcqnlsExcl n hn e, taking any f ≠ e, a common circuit for e and f would have to contain e; but the only circuit is univ.erase e, which excludes e, so the matroid is disconnected (mcqnlsExcl_not_connected). For the free matroid freeOn Set.univ, every subset is independent, so no circuits exist; by not_matroid_connected_of_indep_ground, having two distinct elements (0 and 1, available since n ≥ 2) with the ground set independent implies it is disconnected (mcqnlsFreeOn_not_connected).

    lines 217–240

    uses Finset.exists_mem_notMem_of_card_lt_card, freeOn, freeOn_ground, freeOn_indep, mcqnlsExcl_ground, mcqnlsExcl_isCircuit_iff, mcqnlsExcl_not_connected, mem_univ, not_matroid_connected_of_indep_ground, subset_refl

    lemma mcqnlsExcl_not_connected {n : ℕ} (hn : 2 ≤ n) (e : Fin n) :
        ¬ matroid_connected (mcqnlsExcl n hn e) := by
      intro hconn
      have hcard : ({e} : Finset (Fin n)).card < (Finset.univ : Finset (Fin n)).card := by
        simp; omega
      obtain ⟨f, -, hf⟩ := Finset.exists_mem_notMem_of_card_lt_card hcard
      have hfe : f ≠ e := by simpa using hf
      have heE : e ∈ (mcqnlsExcl n hn e).E := by rw [mcqnlsExcl_ground hn]; exact mem_univ e
      have hfE : f ∈ (mcqnlsExcl n hn e).E := by rw [mcqnlsExcl_ground hn]; exact mem_univ f
      rcases hconn e heE f hfE with rfl | ⟨C, hC, heC, -⟩
      · exact hfe rfl
      · rw [mcqnlsExcl_isCircuit_iff hn e] at hC
        rw [hC] at heC
        simp at heC
    
    lemma mcqnlsFreeOn_not_connected {n : ℕ} (hn : 2 ≤ n) :
        ¬ matroid_connected (freeOn (Set.univ : Set (Fin n))) := by
      refine not_matroid_connected_of_indep_ground (freeOn (Set.univ : Set (Fin n)))
        ⟨0, by omega⟩ ⟨1, by omega⟩ ?_ ?_ ?_ ?_
      · rw [freeOn_ground]; exact mem_univ _
      · rw [freeOn_ground]; exact mem_univ _
      · simp
      · rw [freeOn_ground]; exact freeOn_indep (subset_refl _)
    
  7. The family of sets F = {Finset.univ} ∪ {univ.erase e : e ∈ Fin n} has cardinality n + 1.

    The map e ↦ univ.erase e from Fin n to finsets is injective because e is the unique missing element. Thus its image has cardinality n (Finset.card_image_of_injective). Moreover, Finset.univ cannot be in this image because every set in the image misses at least one element. Inserting Finset.univ into this image therefore yields cardinality n + 1 (Finset.card_insert_of_notMem).

    lines 241–260

    uses Finset.card_image_of_injective, Finset.card_insert_of_notMem, Finset.mem_erase, Finset.mem_image, Finset.mem_univ

    lemma mcqnlsFamilyCard {n : ℕ} (_hn : 2 ≤ n) :
        (insert (Finset.univ : Finset (Fin n))
          (Finset.univ.image (fun e : Fin n => Finset.univ.erase e))).card = n + 1 := by
      have hinj : Function.Injective (fun e : Fin n => (Finset.univ.erase e : Finset (Fin n))) := by
        intro e f hef
        by_contra hne
        have hef' : (Finset.univ.erase e : Finset (Fin n)) = Finset.univ.erase f := hef
        have hmem : e ∈ (Finset.univ.erase f : Finset (Fin n)) := by simp [Finset.mem_erase, hne]
        rw [← hef'] at hmem; simp at hmem
      have hcard_img : (Finset.univ.image (fun e : Fin n => Finset.univ.erase e)).card = n := by
        rw [Finset.card_image_of_injective _ hinj]; simp
      have hnotmem : (Finset.univ : Finset (Fin n)) ∉
          Finset.univ.image (fun e : Fin n => Finset.univ.erase e) := by
        intro h
        rw [Finset.mem_image] at h
        obtain ⟨e, -, he⟩ := h
        have hmem : e ∈ (Finset.univ.erase e : Finset (Fin n)) := by rw [he]; exact Finset.mem_univ e
        simp at hmem
      rw [Finset.card_insert_of_notMem hnotmem, hcard_img]
    
  8. No deterministic decision tree of depth at most n can decide matroid connectedness on n elements.

    We apply the sensitivity lower bound matroid_connectedness_query_not_le_of_sensitive with the connected uniform matroid M = mcqnlsUnif n and the family F of size n + 1. For each S ∈ F, we find a disconnected matroid N agreeing with M on all queries S' ≠ S: if S = Finset.univ, N = freeOn Set.univ is disconnected and agrees with M on all proper subsets S' since both make them independent; if S = univ.erase e, N = mcqnlsExcl n hn e is disconnected and agrees with M on all S' ≠ S since S' is independent in N iff |S'| ≤ n - 1 (the exception S' = univ.erase e does not apply). Since |F| = n + 1 > n, no query tree of depth at most n can decide connectedness.

    lines 261–285

    uses Finset.card_le_univ, Finset.eq_univ_of_card, Finset.mem_image, Finset.mem_insert, freeOn, freeOn_ground, freeOn_indep_iff, matroid_connectedness_query_not_le_of_sensitive, mcqnlsExcl, mcqnlsExcl_ground, mcqnlsExcl_indep_finset, mcqnlsExcl_not_connected, mcqnlsFamilyCard, mcqnlsFreeOn_not_connected, mcqnlsUnif, mcqnlsUnif_connected, mcqnlsUnif_ground, mcqnlsUnif_indep_finset, subset_univ

    theorem matroid_connectedness_query_not_le_self (n : ℕ) (hn : 2 ≤ n) :
        ¬ matroid_connectedness_query_le n n := by
      refine matroid_connectedness_query_not_le_of_sensitive (mcqnlsUnif n) (mcqnlsUnif_ground n)
        (mcqnlsUnif_connected hn)
        (insert (Finset.univ : Finset (Fin n))
          (Finset.univ.image (fun e : Fin n => Finset.univ.erase e))) ?_ n ?_
      · intro S hS
        simp only [Finset.mem_insert, Finset.mem_image] at hS
        rcases hS with rfl | ⟨e, -, he⟩
        · refine ⟨freeOn (Set.univ : Set (Fin n)), freeOn_ground,
            mcqnlsFreeOn_not_connected hn, ?_⟩
          intro S' hS'
          rw [freeOn_indep_iff, mcqnlsUnif_indep_finset]
          refine ⟨fun _ => ?_, fun _ => subset_univ _⟩
          have hle : S'.card ≤ n := by simpa using Finset.card_le_univ S'
          have hne : S'.card ≠ n := fun hc =>
            hS' (Finset.eq_univ_of_card S' (by simpa using hc))
          omega
        · rw [← he]
          refine ⟨mcqnlsExcl n hn e, mcqnlsExcl_ground hn e,
            mcqnlsExcl_not_connected hn e, ?_⟩
          intro S' hS'
          rw [mcqnlsExcl_indep_finset hn e, mcqnlsUnif_indep_finset]
          simp [hS']
      · rw [mcqnlsFamilyCard hn]; omega
Finset.card_image_of_injective
The image of a finset under an injective function has the same cardinality as the domain finset.
Finset.card_insert_of_notMem
Inserting an element not in a finset increases its cardinality by 1.
Finset.card_le_univ
The cardinality of any finset of a finite type is at most the cardinality of the full type.
Finset.card_le_card
If a finset is a subset of another, its cardinality is less than or equal to the other's cardinality.
Finset.card_erase_of_mem
Removing an element from a finset decreases its cardinality by 1 if the element is present.
Finset.coe_erase
Coercing a finset with an erased element to a set yields the set difference.
Finset.coe_univ
Coercing the universal finset Finset.univ yields the universal set Set.univ.
Finset.eq_univ_of_card
A finset in a finite type whose cardinality equals the type's cardinality is the universal finset.
Finset.eq_of_subset_of_card_le
If s ⊆ t and |t| ≤ |s|, then s = t for finsets.
Finset.exists_mem_notMem_of_card_lt_card
If |s| < |t|, there is an element belonging to t that is not in s.
Finset.mem_erase
Membership in an erased finset: x ∈ s.erase a iff x ≠ a and x ∈ s.
Finset.mem_image
Membership in the image of a finset under a function.
Finset.mem_insert
Membership in an inserted finset: x ∈ insert a s iff x = a or x ∈ s.
Finset.mem_insert_of_mem
An element belongs to insert b s if it belongs to s.
Finset.mem_insert_self
An element belongs to insert a s.
Finset.mem_univ
Every element of a finite type belongs to the universal finset Finset.univ.
freeOn
The free matroid on a set E, where every subset of E is independent.
freeOn_ground
The ground set of freeOn E is E.
freeOn_indep
Every subset of the ground set is independent in the free matroid.
freeOn_indep_iff
A set is independent in freeOn E if and only if it is a subset of E.
IndepMatroid.ofFinset
Constructs an IndepMatroid from a predicate on finite sets satisfying the empty-set, hereditary, augmentation, and ground containment axioms.
IndepMatroid.ofFinset_indep'
A set is independent in an IndepMatroid.ofFinset matroid iff every finite subset satisfies the finite independence predicate.
IndepMatroid.matroid_indep_iff
A set is independent in the matroid induced by an IndepMatroid iff it is independent in the IndepMatroid.
le_of_eq
If a = b, then a ≤ b.
le_trans
Transitivity of the inequality relation ≤.
Matroid.dep_iff
A set is dependent in a matroid iff it is a subset of the ground set and not independent.
Matroid.isCircuit_iff
A set is a circuit of a matroid iff it is dependent and minimal among dependent sets.
mcqnlsUnif
The uniform matroid U_{n-1, n} on ground set Fin n.
mcqnlsUnif_ground
The ground set of mcqnlsUnif n is Set.univ.
mcqnlsUnifIndep
Predicate defining independent finite sets of mcqnlsUnif n as those of cardinality at most n - 1.
mcqnlsUnifIndep_empty
The empty set satisfies mcqnlsUnifIndep n.
mcqnlsUnifIndep_subset
The hereditary axiom holds for mcqnlsUnifIndep n.
mcqnlsUnifIndep_aug
The augmentation axiom holds for mcqnlsUnifIndep n.
mcqnlsUnif_indep_finset
A finset is independent in mcqnlsUnif n iff its cardinality is at most n - 1.
mcqnlsUnif_indep_iff
For n ≥ 1, a set I is independent in mcqnlsUnif n iff I ≠ Set.univ.
mcqnlsUnif_connected
For n ≥ 2, the uniform matroid mcqnlsUnif n is connected.
mcqnlsExclIndep
Predicate defining independent finsets of mcqnlsExcl n e: cardinality at most n - 1 and not equal to univ.erase e.
mcqnlsEraseCard
The finset univ.erase e has cardinality n - 1.
mcqnlsExclIndep_empty
For n ≥ 2, the empty set satisfies mcqnlsExclIndep n e.
mcqnlsExclIndep_subset
The hereditary axiom holds for mcqnlsExclIndep n e.
mcqnlsExclIndep_aug
The augmentation axiom holds for mcqnlsExclIndep n e.
mcqnlsExcl
The matroid on Fin n where univ.erase e is excluded from independence.
mcqnlsExcl_ground
The ground set of mcqnlsExcl n hn e is Set.univ.
mcqnlsExcl_indep_finset
A finset is independent in mcqnlsExcl n hn e iff its cardinality is at most n - 1 and it is not univ.erase e.
mcqnlsExcl_indep_iff
For n ≥ 2, a set is independent in mcqnlsExcl n hn e iff it differs from both Set.univ and univ.erase e.
mcqnlsExcl_isCircuit_iff
For n ≥ 2, the unique circuit of mcqnlsExcl n hn e is univ.erase e.
mcqnlsExcl_not_connected
For n ≥ 2, mcqnlsExcl n hn e is not connected.
mcqnlsFreeOn_not_connected
For n ≥ 2, the free matroid on Fin n is not connected.
mcqnlsFamilyCard
The family of subsets consisting of Set.univ and all univ.erase e has cardinality n + 1.
matroid_connectedness_query_not_le_of_sensitive
Lower bound on matroid query complexity: if a connected matroid has a sensitive family of size > q, depth q cannot decide connectedness.
mem_univ
Every element belongs to Set.univ.
not_matroid_connected_of_indep_ground
A matroid with at least two elements whose entire ground set is independent is not connected.
Or.inr
Right injection for logical disjunction: b implies a ∨ b.
subset_univ
Every set is a subset of Set.univ.
subset_refl
Every set is a subset of itself.
subset_antisymm
Antisymmetry of subset inclusion: s ⊆ t and t ⊆ s imply s = t.

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 Matroid Setdef mcqnlsUnifIndep (n : ℕ) : Finset (Fin n) → Prop := fun I => I.card ≤ n - 1lemma mcqnlsUnifIndep_empty (n : ℕ) : mcqnlsUnifIndep n ∅ := by  simp [mcqnlsUnifIndep]lemma mcqnlsUnifIndep_subset {n : ℕ} {I J : Finset (Fin n)}    (hJ : mcqnlsUnifIndep n J) (hIJ : I ⊆ J) : mcqnlsUnifIndep n I := by  simp only [mcqnlsUnifIndep] at hJ ⊢  exact le_trans (Finset.card_le_card hIJ) hJlemma mcqnlsUnifIndep_aug {n : ℕ} {I J : Finset (Fin n)}    (hI : mcqnlsUnifIndep n I) (hJ : mcqnlsUnifIndep n J) (hlt : I.card < J.card) :    ∃ e ∈ J, e ∉ I ∧ mcqnlsUnifIndep n (insert e I) := by  simp only [mcqnlsUnifIndep] at hI hJ ⊢  obtain ⟨e, heJ, heI⟩ := Finset.exists_mem_notMem_of_card_lt_card hlt  exact ⟨e, heJ, heI, by rw [Finset.card_insert_of_notMem heI]; omega⟩noncomputable def mcqnlsUnif (n : ℕ) : Matroid (Fin n) :=  (IndepMatroid.ofFinset (E := Set.univ) (mcqnlsUnifIndep n)    (mcqnlsUnifIndep_empty n)    (fun _ _ hJ hIJ => mcqnlsUnifIndep_subset hJ hIJ)    (fun _ _ hI hJ hlt => mcqnlsUnifIndep_aug hI hJ hlt)    (by intro I _; exact subset_univ (I : Set (Fin n)))).matroidlemma mcqnlsUnif_ground (n : ℕ) : (mcqnlsUnif n).E = Set.univ := rfllemma mcqnlsUnif_indep_finset {n : ℕ} {I : Finset (Fin n)} :    (mcqnlsUnif n).Indep (I : Set (Fin n)) ↔ I.card ≤ n - 1 := by  simp [mcqnlsUnif, mcqnlsUnifIndep]lemma mcqnlsUnif_indep_iff {n : ℕ} (hn : 1 ≤ n) {I : Set (Fin n)} :    (mcqnlsUnif n).Indep I ↔ I ≠ Set.univ := by  rw [mcqnlsUnif, IndepMatroid.matroid_indep_iff, IndepMatroid.ofFinset_indep']  constructor  · intro h hI    subst hI    have h1 := h Finset.univ (by simp)    simp only [mcqnlsUnifIndep] at h1    have h2 : (Finset.univ : Finset (Fin n)).card = n := by simp    omega  · intro hI J hJ    simp only [mcqnlsUnifIndep]    by_contra hc    push Not at hc    have hJn : J.card = n := by      have hle : J.card ≤ n := by simpa using Finset.card_le_univ J      omega    have hJuniv : J = Finset.univ := Finset.eq_univ_of_card J (by simpa using hJn)    have hsub : (Set.univ : Set (Fin n)) ⊆ I := by      rw [← Finset.coe_univ, ← hJuniv]; exact hJ    exact hI (subset_antisymm (subset_univ I) hsub)lemma mcqnlsUnif_connected {n : ℕ} (hn : 2 ≤ n) : matroid_connected (mcqnlsUnif n) := by  intro e he f hf  refine Or.inr ⟨Set.univ, ?_, trivial, trivial⟩  rw [Matroid.isCircuit_iff]  constructor  · rw [Matroid.dep_iff]    refine ⟨?_, subset_univ _⟩    intro hI    exact ((mcqnlsUnif_indep_iff (by omega) (I := Set.univ)).mp hI) rfl  · intro D hD hDsub    rw [Matroid.dep_iff] at hD    by_contra hne    exact hD.1 ((mcqnlsUnif_indep_iff (by omega) (I := D)).mpr hne)def mcqnlsExclIndep (n : ℕ) (e : Fin n) : Finset (Fin n) → Prop :=  fun I => I.card ≤ n - 1 ∧ I ≠ Finset.univ.erase elemma mcqnlsEraseCard {n : ℕ} (e : Fin n) :    (Finset.univ.erase e : Finset (Fin n)).card = n - 1 := by  rw [Finset.card_erase_of_mem (Finset.mem_univ e)]; simplemma mcqnlsExclIndep_empty {n : ℕ} (hn : 2 ≤ n) (e : Fin n) : mcqnlsExclIndep n e ∅ := by  refine ⟨by simp [mcqnlsExclIndep], ?_⟩  intro h  have hc : (Finset.univ.erase e : Finset (Fin n)).card = 0 := by rw [← h]; simp  rw [mcqnlsEraseCard] at hc; omegalemma mcqnlsExclIndep_subset {n : ℕ} {e : Fin n} {I J : Finset (Fin n)}    (hJ : mcqnlsExclIndep n e J) (hIJ : I ⊆ J) : mcqnlsExclIndep n e I := by  obtain ⟨hJc, hJne⟩ := hJ  refine ⟨le_trans (Finset.card_le_card hIJ) hJc, ?_⟩  intro hI  apply hJne  have hbJ : Finset.univ.erase e ⊆ J := hI ▸ hIJ  have hcJ : J.card ≤ (Finset.univ.erase e : Finset (Fin n)).card := by    rw [mcqnlsEraseCard]; exact hJc  exact (Finset.eq_of_subset_of_card_le hbJ hcJ).symmlemma mcqnlsExclIndep_aug {n : ℕ} {e : Fin n} {I J : Finset (Fin n)}    (hI : mcqnlsExclIndep n e I) (hJ : mcqnlsExclIndep n e J) (hlt : I.card < J.card) :    ∃ f ∈ J, f ∉ I ∧ mcqnlsExclIndep n e (insert f I) := by  obtain ⟨hIc, hIne⟩ := hI  obtain ⟨hJc, hJne⟩ := hJ  by_cases h : ∃ f ∈ J, f ∉ I ∧ insert f I ≠ Finset.univ.erase e  · obtain ⟨f, hfJ, hfI, hfb⟩ := h    exact ⟨f, hfJ, hfI, by rw [Finset.card_insert_of_notMem hfI]; omega, hfb⟩  · exfalso    push Not at h    obtain ⟨f0, hf0J, hf0I⟩ := Finset.exists_mem_notMem_of_card_lt_card hlt    have hb0 : insert f0 I = Finset.univ.erase e := h f0 hf0J hf0I    have hJb : J ⊆ Finset.univ.erase e := by      intro x hxJ      by_cases hxI : x ∈ I      · rw [← hb0]; exact Finset.mem_insert_of_mem hxI      · rw [← h x hxJ hxI]; exact Finset.mem_insert_self x I    have hJble : J.card ≤ (Finset.univ.erase e : Finset (Fin n)).card :=      Finset.card_le_card hJb    have hcJ : J.card = (Finset.univ.erase e : Finset (Fin n)).card := by      have hins : (insert f0 I : Finset (Fin n)).card = I.card + 1 :=        Finset.card_insert_of_notMem hf0I      rw [hb0] at hins; omega    exact hJne (Finset.eq_of_subset_of_card_le hJb (le_of_eq hcJ.symm))noncomputable def mcqnlsExcl (n : ℕ) (hn : 2 ≤ n) (e : Fin n) : Matroid (Fin n) :=  (IndepMatroid.ofFinset (E := Set.univ) (mcqnlsExclIndep n e)    (mcqnlsExclIndep_empty hn e)    (fun _ _ hJ hIJ => mcqnlsExclIndep_subset hJ hIJ)    (fun _ _ hI hJ hlt => mcqnlsExclIndep_aug hI hJ hlt)    (by intro I _; exact subset_univ (I : Set (Fin n)))).matroidlemma mcqnlsExcl_ground {n : ℕ} (hn : 2 ≤ n) (e : Fin n) :    (mcqnlsExcl n hn e).E = Set.univ := rfllemma mcqnlsExcl_indep_finset {n : ℕ} (hn : 2 ≤ n) (e : Fin n) {I : Finset (Fin n)} :    (mcqnlsExcl n hn e).Indep (I : Set (Fin n)) ↔      I.card ≤ n - 1 ∧ I ≠ Finset.univ.erase e := by  simp [mcqnlsExcl, mcqnlsExclIndep]lemma mcqnlsExcl_indep_iff {n : ℕ} (hn : 2 ≤ n) (e : Fin n) {I : Set (Fin n)} :    (mcqnlsExcl n hn e).Indep I ↔ I ≠ Set.univ ∧ I ≠ (Finset.univ.erase e : Set (Fin n)) := by  rw [mcqnlsExcl, IndepMatroid.matroid_indep_iff, IndepMatroid.ofFinset_indep']  constructor  · intro h    refine ⟨?_, ?_⟩    · intro hI      subst hI      have h1 := h Finset.univ (by simp)      simp only [mcqnlsExclIndep] at h1      have h2 : (Finset.univ : Finset (Fin n)).card = n := by simp      omega    · intro hI      have h1 := h (Finset.univ.erase e) (by rw [hI])      simp only [mcqnlsExclIndep] at h1      exact h1.2 rfl  · intro ⟨hU, hB⟩ J hJ    constructor    · by_contra hc      push Not at hc      have hJn : J.card = n := by        have hle : J.card ≤ n := by simpa using Finset.card_le_univ J        omega      have hJuniv : J = Finset.univ := Finset.eq_univ_of_card J (by simpa using hJn)      apply hU      have hsub : (Set.univ : Set (Fin n)) ⊆ I := by        rw [← Finset.coe_univ, ← hJuniv]; exact hJ      exact subset_antisymm (subset_univ I) hsub    · intro hJb      apply hB      have hsub : (Finset.univ.erase e : Set (Fin n)) ⊆ I := by rw [← hJb]; exact hJ      have hsub' : (Set.univ \ {e} : Set (Fin n)) ⊆ I := by        rw [Finset.coe_erase, Finset.coe_univ] at hsub; exact hsub      apply subset_antisymm ?_ hsub      intro x hx      rw [Finset.coe_erase, Finset.coe_univ]      refine ⟨trivial, ?_⟩      intro hxe      apply hU      apply subset_antisymm (subset_univ I)      intro y _      by_cases hy : y = e      · rw [hy]; exact hxe ▸ hx      · exact hsub' (by simp [hy])lemma mcqnlsExcl_isCircuit_iff {n : ℕ} (hn : 2 ≤ n) (e : Fin n) {C : Set (Fin n)} :    (mcqnlsExcl n hn e).IsCircuit C ↔ C = (Finset.univ.erase e : Set (Fin n)) := by  rw [Matroid.isCircuit_iff]  constructor  · rintro ⟨hdep, hmin⟩    have hcases : C = Set.univ ∨ C = (Finset.univ.erase e : Set (Fin n)) := by      by_contra hc      push Not at hc      exact hdep.1 ((mcqnlsExcl_indep_iff hn e).mpr hc)    rcases hcases with h | h    · exfalso      have hdepb : (mcqnlsExcl n hn e).Dep (Finset.univ.erase e : Set (Fin n)) := by        rw [Matroid.dep_iff]        refine ⟨?_, subset_univ _⟩        intro hind        exact ((mcqnlsExcl_indep_iff hn e).mp hind).2 rfl      have hbC : (Finset.univ.erase e : Set (Fin n)) ⊆ C := by rw [h]; exact subset_univ _      have heq := hmin hdepb hbC      rw [h] at heq      have hmem : e ∈ (Finset.univ.erase e : Set (Fin n)) := by        rw [heq]; exact mem_univ e      simp at hmem    · exact h  · intro hC    subst hC    constructor    · rw [Matroid.dep_iff]      refine ⟨?_, subset_univ _⟩      intro hind      exact ((mcqnlsExcl_indep_iff hn e).mp hind).2 rfl    · intro D hD hDC      rw [Matroid.dep_iff] at hD      by_contra hne      have hDuniv : D = Set.univ := by        by_contra hnu        exact hD.1 ((mcqnlsExcl_indep_iff hn e).mpr ⟨hnu, hne⟩)      rw [hDuniv] at hDC      exact absurd (hDC (mem_univ e)) (by simp)lemma mcqnlsExcl_not_connected {n : ℕ} (hn : 2 ≤ n) (e : Fin n) :    ¬ matroid_connected (mcqnlsExcl n hn e) := by  intro hconn  have hcard : ({e} : Finset (Fin n)).card < (Finset.univ : Finset (Fin n)).card := by    simp; omega  obtain ⟨f, -, hf⟩ := Finset.exists_mem_notMem_of_card_lt_card hcard  have hfe : f ≠ e := by simpa using hf  have heE : e ∈ (mcqnlsExcl n hn e).E := by rw [mcqnlsExcl_ground hn]; exact mem_univ e  have hfE : f ∈ (mcqnlsExcl n hn e).E := by rw [mcqnlsExcl_ground hn]; exact mem_univ f  rcases hconn e heE f hfE with rfl | ⟨C, hC, heC, -⟩  · exact hfe rfl  · rw [mcqnlsExcl_isCircuit_iff hn e] at hC    rw [hC] at heC    simp at heClemma mcqnlsFreeOn_not_connected {n : ℕ} (hn : 2 ≤ n) :    ¬ matroid_connected (freeOn (Set.univ : Set (Fin n))) := by  refine not_matroid_connected_of_indep_ground (freeOn (Set.univ : Set (Fin n)))    ⟨0, by omega⟩ ⟨1, by omega⟩ ?_ ?_ ?_ ?_  · rw [freeOn_ground]; exact mem_univ _  · rw [freeOn_ground]; exact mem_univ _  · simp  · rw [freeOn_ground]; exact freeOn_indep (subset_refl _)lemma mcqnlsFamilyCard {n : ℕ} (_hn : 2 ≤ n) :    (insert (Finset.univ : Finset (Fin n))      (Finset.univ.image (fun e : Fin n => Finset.univ.erase e))).card = n + 1 := by  have hinj : Function.Injective (fun e : Fin n => (Finset.univ.erase e : Finset (Fin n))) := by    intro e f hef    by_contra hne    have hef' : (Finset.univ.erase e : Finset (Fin n)) = Finset.univ.erase f := hef    have hmem : e ∈ (Finset.univ.erase f : Finset (Fin n)) := by simp [Finset.mem_erase, hne]    rw [← hef'] at hmem; simp at hmem  have hcard_img : (Finset.univ.image (fun e : Fin n => Finset.univ.erase e)).card = n := by    rw [Finset.card_image_of_injective _ hinj]; simp  have hnotmem : (Finset.univ : Finset (Fin n)) ∉      Finset.univ.image (fun e : Fin n => Finset.univ.erase e) := by    intro h    rw [Finset.mem_image] at h    obtain ⟨e, -, he⟩ := h    have hmem : e ∈ (Finset.univ.erase e : Finset (Fin n)) := by rw [he]; exact Finset.mem_univ e    simp at hmem  rw [Finset.card_insert_of_notMem hnotmem, hcard_img]theorem matroid_connectedness_query_not_le_self (n : ℕ) (hn : 2 ≤ n) :    ¬ matroid_connectedness_query_le n n := by  refine matroid_connectedness_query_not_le_of_sensitive (mcqnlsUnif n) (mcqnlsUnif_ground n)    (mcqnlsUnif_connected hn)    (insert (Finset.univ : Finset (Fin n))      (Finset.univ.image (fun e : Fin n => Finset.univ.erase e))) ?_ n ?_  · intro S hS    simp only [Finset.mem_insert, Finset.mem_image] at hS    rcases hS with rfl | ⟨e, -, he⟩    · refine ⟨freeOn (Set.univ : Set (Fin n)), freeOn_ground,        mcqnlsFreeOn_not_connected hn, ?_⟩      intro S' hS'      rw [freeOn_indep_iff, mcqnlsUnif_indep_finset]      refine ⟨fun _ => ?_, fun _ => subset_univ _⟩      have hle : S'.card ≤ n := by simpa using Finset.card_le_univ S'      have hne : S'.card ≠ n := fun hc =>        hS' (Finset.eq_univ_of_card S' (by simpa using hc))      omega    · rw [← he]      refine ⟨mcqnlsExcl n hn e, mcqnlsExcl_ground hn e,        mcqnlsExcl_not_connected hn e, ?_⟩      intro S' hS'      rw [mcqnlsExcl_indep_finset hn e, mcqnlsUnif_indep_finset]      simp [hS']  · rw [mcqnlsFamilyCard hn]; omega
See it in the graphDiscuss this resultChallenge it