cfahlgren1/math / lean /ComparatorChallenges /MatroidProphet.lean
cfahlgren1's picture
download
raw
4 kB
import Mathlib
namespace OAI
/-!
# One-sample matroid selection
The rule and its finite seed law depend only on the known labeled matroid.
A decision sees the initial sample vector, the entire seed, and the arriving
label/value prefix. Every prefix is feasible, and decisions are irrevocable.
The arrival permutation may depend on all samples, values, and seed bits.
Only the actual offline optimum is required to be integrable.
-/
open MeasureTheory ProbabilityTheory
open scoped BigOperators
namespace MatroidProphet
abbrev Weights (n : ℕ) := Fin n → ℝ
abbrev Seed (bits : ℕ) := Fin bits → Bool
abbrev ArrivalOrder (n : ℕ) := Equiv.Perm (Fin n)
instance arrivalOrderMeasurableSpace (n : ℕ) : MeasurableSpace (ArrivalOrder n) := ⊤
abbrev History (n : ℕ) (k : Fin n) := Fin (k.val + 1) → Fin n × ℝ
structure OnlineRule (n bits : ℕ) where
decide : (k : Fin n) → Seed bits → Weights n → History n k → Bool
measurable_decide : ∀ k, Measurable
(fun x : Seed bits × (Weights n × History n k) => decide k x.1 x.2.1 x.2.2)
def prefixIndex {n : ℕ} (k : Fin n) (j : Fin (k.val + 1)) : Fin n :=
⟨j.val, Nat.lt_of_lt_of_le j.isLt (Nat.succ_le_of_lt k.isLt)⟩
def history {n : ℕ} (v : Weights n) (π : ArrivalOrder n) (k : Fin n) : History n k :=
fun j => let e := π (prefixIndex k j); (e, v e)
def decisionAt {n bits : ℕ} (A : OnlineRule n bits) (r : Seed bits)
(s v : Weights n) (π : ArrivalOrder n) (k : Fin n) : Bool :=
A.decide k r s (history v π k)
noncomputable def acceptedThrough {n bits : ℕ} (A : OnlineRule n bits) (r : Seed bits)
(s v : Weights n) (π : ArrivalOrder n) (t : ℕ) : Finset (Fin n) := by
classical
exact Finset.univ.filter fun e =>
(π.symm e).val < t ∧ decisionAt A r s v π (π.symm e) = true
noncomputable def accepted {n bits : ℕ} (A : OnlineRule n bits) (r : Seed bits)
(s v : Weights n) (π : ArrivalOrder n) : Finset (Fin n) :=
acceptedThrough A r s v π n
noncomputable def reward {n bits : ℕ} (A : OnlineRule n bits) (r : Seed bits)
(s v : Weights n) (π : ArrivalOrder n) : ℝ :=
∑ e ∈ accepted A r s v π, v e
noncomputable def optimum {n : ℕ} (M : Matroid (Fin n)) (v : Weights n) : ℝ := by
classical
exact Finset.univ.sup' Finset.univ_nonempty
(fun I : Finset (Fin n) => if M.Indep (I : Set (Fin n)) then ∑ e ∈ I, v e else 0)
def Feasible {n bits : ℕ} (M : Matroid (Fin n)) (A : OnlineRule n bits) : Prop :=
∀ (r : Seed bits) (s v : Weights n) (π : ArrivalOrder n) (t : ℕ),
(∀ e, 0 ≤ s e) → (∀ e, 0 ≤ v e) →
M.Indep (acceptedThrough A r s v π t : Set (Fin n))
def pairedCoordinates.{u} {n : ℕ} {Ω : Type u} (S V : Ω → Weights n)
(i : Fin n × Bool) : Ω → ℝ :=
if i.2 then fun ω => S ω i.1 else fun ω => V ω i.1
def OneSampleChallenge.{u} : Prop :=
∀ (n : ℕ) (M : Matroid (Fin n)), M.E = Set.univ →
∃ (bits : ℕ) (ν : Measure (Seed bits)), IsProbabilityMeasure ν ∧
∃ (A : OnlineRule n bits), Feasible M A ∧
∀ {Ω : Type u} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ]
(S V : Ω → Weights n) (R : Ω → Seed bits),
Measurable S → Measurable V → Measurable R →
(∀ᵐ ω ∂μ, ∀ e, 0 ≤ S ω e) →
(∀ᵐ ω ∂μ, ∀ e, 0 ≤ V ω e) →
iIndepFun (pairedCoordinates S V) μ →
(∀ e, Measure.map (fun ω => S ω e) μ = Measure.map (fun ω => V ω e) μ) →
IndepFun (fun ω => (S ω, V ω)) R μ →
Measure.map R μ = ν →
Integrable (fun ω => optimum M (V ω)) μ →
∀ (π : Ω → ArrivalOrder n), Measurable π →
Integrable (fun ω => reward A (R ω) (S ω) (V ω) (π ω)) μ ∧
((2 : ℝ) ^ 310)⁻¹ * (∫ ω, optimum M (V ω) ∂μ) ≤
∫ ω, reward A (R ω) (S ω) (V ω) (π ω) ∂μ
theorem one_sample.{u} : OneSampleChallenge.{u} := by
sorry
end MatroidProphet
end OAI

Xet Storage Details

Size:
4 kB
·
Xet hash:
a943247d96a00ced126055cd82a27688f10bc6e983da362bffc087ca3c3a8f75

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.