Documentation

CslibFrontier.Algorithms.Lean.Query.Submodular.ValueQuery

Value Queries for Set-Function Optimization #

ValueQuery α β is the query signature for algorithms that access an unknown set function f : Finset α → β through a value oracle ([NW78], Section 2): a query ValueQuery.value S asks for the value f S : β of a finite subset S : Finset α.

In addition to the standard ask and oracleOf combinators, this module defines ValueQuery.queriedSets, which records the exact Finset (Finset α) of subsets inspected along an execution path, and proves the path-indistinguishability lemma ValueQuery.eval_eq_of_agree_on_queriedSets used in adversarial value-oracle lower bounds.

Main definitions #

Main results #

References #

inductive Cslib.Query.ValueQuery (α β : Type) :

Value-oracle query signature for set functions Finset α → β: .value S requests f S : β.

@[reducible, inline]
abbrev Cslib.Query.ValueQuery.ask {α β : Type} (S : Finset α) :
FreeM (ValueQuery α β) β

Query the value of subset S in FreeM (ValueQuery α β) β.

@[simp]
theorem Cslib.Query.ValueQuery.eval_ask {α β : Type} (oracle : {ι : Type} → ValueQuery α β ι → ι) (S : Finset α) :
FreeM.eval (fun {ι : Type} => oracle) (ask S) = oracle (value S)
theorem Cslib.Query.ValueQuery.countQueries_ask {α β : Type} (oracle : {ι : Type} → ValueQuery α β ι → ι) (S : Finset α) :
FreeM.countQueries (fun {ι : Type} => oracle) (ask S) = 1
def Cslib.Query.ValueQuery.oracleOf {α β : Type} (f : Finset α → β) {ι : Type} :
ValueQuery α β ι → ι

Turn a set function f : Finset α → β into a ValueQuery α β oracle.

@[simp]
theorem Cslib.Query.ValueQuery.oracleOf_value {α β : Type} (f : Finset α → β) (S : Finset α) :
oracleOf f (value S) = f S
def Cslib.Query.ValueQuery.queriedSets {α β γ : Type} [DecidableEq α] (oracle : {ι : Type} → ValueQuery α β ι → ι) :
FreeM (ValueQuery α β) γ → Finset (Finset α)

The finite set of subsets queried along the execution path of p against oracle.

@[simp]
theorem Cslib.Query.ValueQuery.queriedSets_pure {α β γ : Type} [DecidableEq α] (oracle : {ι : Type} → ValueQuery α β ι → ι) (a : γ) :
queriedSets (fun {ι : Type} => oracle) (pure a) = ∅
@[simp]
theorem Cslib.Query.ValueQuery.queriedSets_liftBind {α β γ : Type} [DecidableEq α] (oracle : {ι : Type} → ValueQuery α β ι → ι) (S : Finset α) (cont : β → FreeM (ValueQuery α β) γ) :
queriedSets (fun {ι : Type} => oracle) (FreeM.lift (value S) >>= cont) = insert S (queriedSets (fun {ι : Type} => oracle) (cont (oracle (value S))))
theorem Cslib.Query.ValueQuery.card_queriedSets_le_countQueries {α β γ : Type} [DecidableEq α] (oracle : {ι : Type} → ValueQuery α β ι → ι) (p : FreeM (ValueQuery α β) γ) :
(queriedSets (fun {ι : Type} => oracle) p).card ≤ FreeM.countQueries (fun {ι : Type} => oracle) p

The number of distinct subsets queried never exceeds the total query count.

theorem Cslib.Query.ValueQuery.eval_and_countQueries_eq_of_agree_on_queriedSets {α β γ : Type} [DecidableEq α] {o₁ o₂ : {ι : Type} → ValueQuery α β ι → ι} (p : FreeM (ValueQuery α β) γ) (hagree : ∀ S ∈ queriedSets (fun {ι : Type} => o₁) p, o₁ (value S) = o₂ (value S)) :
FreeM.eval (fun {ι : Type} => o₁) p = FreeM.eval (fun {ι : Type} => o₂) p ∧ FreeM.countQueries (fun {ι : Type} => o₁) p = FreeM.countQueries (fun {ι : Type} => o₂) p

If two oracles return identical values on every subset in ValueQuery.queriedSets o₁ p, then p follows the exact same execution branch under both oracles and produces the same output and query count.

theorem Cslib.Query.ValueQuery.eval_eq_of_agree_on_queriedSets {α β γ : Type} [DecidableEq α] {o₁ o₂ : {ι : Type} → ValueQuery α β ι → ι} (p : FreeM (ValueQuery α β) γ) (hagree : ∀ S ∈ queriedSets (fun {ι : Type} => o₁) p, o₁ (value S) = o₂ (value S)) :
FreeM.eval (fun {ι : Type} => o₁) p = FreeM.eval (fun {ι : Type} => o₂) p