math / data /lean /OAI /Probability /MatroidSecretary /Selection /CandidateSpecification.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
2.27 kB
import Mathlib.Combinatorics.Matroid.Closure
import OAI.Probability.MatroidProphet.Main
namespace OAI
namespace MatroidProphet.CandidateSpecification
open Finset
/-- Strict rounded-weight priority, including the fixed label tie-breaking rule. -/
def higher {n : β„•} (f : Fin n) (a : Option β„€) (e : Fin n) (b : Option β„€) : Prop :=
match a, b with
| some i, some j => j < i ∨ j = i ∧ f < e
| some _, none => True
| _, _ => False
/-- Source candidate set: positive, unobserved, and not spanned by higher-priority
observed labels. The full candidate set is analytical, not given to the algorithm. -/
noncomputable def candidates {n : β„•} (M : Matroid (Fin n))
(a : Fin n β†’ Option β„€) (H : Finset (Fin n)) : Finset (Fin n) := by
classical
exact Finset.univ.filter fun e => a e β‰  none ∧ e βˆ‰ H ∧
e βˆ‰ M.closure {f | f ∈ H ∧ higher f (a f) e (a e)}
/-- Positive priority-greedy on the entire ground set, characterized by failure
of the strictly higher-priority labels to span the current label. -/
noncomputable def greedy {n : β„•} (M : Matroid (Fin n))
(a : Fin n β†’ Option β„€) : Finset (Fin n) := by
classical
exact Finset.univ.filter fun e => a e β‰  none ∧
e βˆ‰ M.closure {f | higher f (a f) e (a e)}
/-- The source comparison independent set after sacrificing the fair mask. -/
noncomputable def survivors {n : β„•} (M : Matroid (Fin n))
(a : Fin n β†’ Option β„€) (H : Finset (Fin n)) : Finset (Fin n) :=
greedy M a \ H
/-- The complete mathematical assertion of Lemma `lem:filter`, stated solely
using the concrete source definitions and the finite independent fair-mask law. -/
def CandidateMass : Prop :=
βˆ€ (n : β„•) (M : Matroid (Fin n)), M.E = Set.univ β†’ βˆ€ w : Weights n,
let a := fun e => roundedLevel weightBase (w e)
let u := fun e => roundedWeight weightBase (w e)
(βˆ€ H, M.Indep (survivors M a H : Set (Fin n)) ∧
survivors M a H βŠ† candidates M a H) ∧
bitsExpectation (fun _ => (1 / 2 : ℝ)) Finset.univ
(fun H => βˆ‘ e ∈ survivors M a H, u e) = optimum M u / 2 ∧
bitsExpectation (fun _ => (1 / 2 : ℝ)) Finset.univ
(fun H => βˆ‘ e ∈ candidates M a H, u e) ≀ optimum M u
end MatroidProphet.CandidateSpecification
end OAI