Documentation

CslibFrontier.Algorithms.Lean.Query.Matroid.IndepQuery

IndepQuery: Independence-Oracle Queries for Matroid Algorithms #

IndepQuery α is the query signature for independence-oracle matroid algorithms in CSLib's FreeM query-complexity framework (Cslib.Algorithms.Lean.Query.FreeM). A single query IndepQuery.indep S tests whether a finite candidate subset S : Finset α is independent, returning Bool.

Decoupling the computable query syntax FreeM (IndepQuery α) from the propositional predicate IndepQuery.ImplementsMatroid oracle M allows algorithms to execute computably against concrete Boolean independence checkers while proving mathematical optimality against arbitrary (possibly noncomputable) Mathlib.Combinatorics.Matroid instances.

Main definitions #

inductive Cslib.Query.IndepQuery (α : Type) :

Independence-oracle query: asks whether the finite subset S : Finset α is independent, returning a Bool.

@[reducible, inline]

Lift IndepQuery.indep S into FreeM (IndepQuery α) Bool.

@[simp]
theorem Cslib.Query.IndepQuery.eval_ask {α : Type} (oracle : {ι : Type} → IndepQuery α ι → ι) (S : Finset α) :
FreeM.eval (fun {ι : Type} => oracle) (ask S) = oracle (indep S)
def Cslib.Query.IndepQuery.oracleOf {α : Type} (f : Finset α → Bool) {ι : Type} :
IndepQuery α ι → ι

Build an IndepQuery α oracle from a Boolean predicate on finite sets Finset α → Bool.

@[simp]
theorem Cslib.Query.IndepQuery.oracleOf_indep {α : Type} (f : Finset α → Bool) (S : Finset α) :
oracleOf f (indep S) = f S
def Cslib.Query.IndepQuery.ImplementsMatroid {α : Type} (oracle : {ι : Type} → IndepQuery α ι → ι) (M : Matroid α) :

ImplementsMatroid oracle M states that oracle faithfully decides finite-set independence in M : Matroid α.

noncomputable def Cslib.Query.IndepQuery.matroidOracle {α : Type} (M : Matroid α) {ι : Type} :
IndepQuery α ι → ι

Classical independence oracle associated with an arbitrary M : Matroid α.

Every IndepQuery α ι has response type ι = Bool, of cardinality 2.