Documentation

CslibFrontier.Probability.OptimalStopping.ProphetSample

The single-sample prophet inequality #

When the laws μ₀, …, μₙ₋₁ of n independent nonnegative values are unknown to the gambler, a single offline sample sᵢ ~ μᵢ from each law suffices to recover the optimal 1/2 prophet guarantee: set the threshold to the maximum of the n samples and accept the first online value that beats it ([RWW20], Definition 1 and Theorem 1, §1–§3, pp. 1–4; the order-oblivious case dates to Azar, Kleinberg and Weinberg, 2014).

When the laws have atoms, ties between online values and the sample maximum must be broken randomly: if X₀ = 1 deterministically (PMF.pure 1), then S₀ = 1 as well, so accepting only values strictly above maxⱼ Sⱼ collects 0 (expectedReward_strictSampleRule_pure_eq_zero), whereas accepting all values at least maxⱼ Sⱼ fails on tightLaws k in the same way as a naive greedy rule. Following [RWW20], §2 ("Continuous vs. Discrete Distributions", p. 2), the gambler draws a uniform permutation π : Equiv.Perm (Fin (2 * n)) of the 2n sample and online slots and compares pairs (value, rank) lexicographically:

The proof uses the deferred-decisions coupling of [RWW20], §3 (Observation 3, Propositions 4 and 5, and Proof of Theorem 1, pp. 3–4), turned into an explicit 2-to-1 injection on the 2ⁿ fair-coin assignments c : Fin n → Bool so that all expectations remain in ℝ≥0∞ with no integrability hypothesis (E[max] may be ⊤). Because μ : Fin n → PMF ℝ≥0 is arbitrary, the same 1/2 bound holds under any arrival permutation σ : Equiv.Perm (Fin n) (expectedMax_le_two_mul_singleSampleExpectedReward_perm).

Main definitions #

Main results #

References #

Slot 2 * i in Fin (2 * n), assigned to offline sample i.

Slot 2 * i + 1 in Fin (2 * n), assigned to online observation i.

@[reducible, inline]

A value in ℝ≥0 paired lexicographically with its tie-breaking rank in Fin (2 * n).

Tag sample j with its rank under π.

Tag an online value x at step i with its rank under π.

The single-sample stopping rule ([RWW20], §2, p. 2): given offline samples s : Fin n → ℝ≥0 and a tie-breaking permutation π : Equiv.Perm (Fin (2 * n)), stop at step i (past.length = i) iff (x, π (2i + 1)) exceeds every tagged sample (s j, π (2j)) in lexicographic order.

Expected reward of the single-sample stopping algorithm on n independent distributions μ: draw one sample vector s ~ piFin μ, an independent uniform permutation π, and run singleSampleRule s π online on jointLaw (List.ofFn μ).

Deterministic strict-maximum rule: accept the first online value strictly exceeding every offline sample s j (and positive when n = 0).

Expected reward of the deterministic strict-maximum rule over s ~ piFin μ.

Relationship between piFin and jointLaw #

Pushing piFin μ along List.ofFn gives jointLaw (List.ofFn μ).

theorem Cslib.Probability.OptimalStopping.Prophet.tsum_jointLaw_ofFn_mul {α : Type u_1} {n : ℕ} (μ : Fin n → PMF α) (f : List α → ENNReal) :
∑' (xs : List α), (jointLaw (List.ofFn μ)) xs * f xs = ∑' (x : Fin n → α), (PMF.piFin μ) x * f (List.ofFn x)

Expectations under jointLaw (List.ofFn μ) rewrite as expectations under piFin μ.

Online execution on a tuple #

noncomputable def Cslib.Probability.OptimalStopping.Prophet.firstBeatReward {n : ℕ} (x s : Fin n → NNReal) (π : Equiv.Perm (Fin (2 * n))) :

The reward collected by scanning i = 0, …, n - 1 and taking the first x i whose tag beats every sample tag.

Combinatorial 2-to-1 coin pairing (Observation 3, Propositions 4–5, Theorem 1) #

Symmetry of sample and online slots under piFin and Equiv.Perm #

Main theorem #

The single-sample prophet inequality ([RWW20], Theorem 1, p. 1, and Proof of Theorem 1, §3, p. 4).

For any n independent nonnegative distributions μ : Fin n → PMF ℝ≥0, given one offline sample sᵢ ~ μᵢ from each distribution and an independent uniform tie-breaking permutation π, the online stopping rule singleSampleRule s π collects in expectation at least half of the prophet's expected maximum expectedMax (List.ofFn μ). No finiteness or atom-freeness hypothesis is needed.

Arrival-order invariance and atom-boundary witness #

Arrival-order invariance: under any fixed arrival permutation σ : Equiv.Perm (Fin n), running the single-sample algorithm on μ ∘ σ achieves at least half of expectedMax (List.ofFn μ).

Without randomized tie-breaking, the deterministic strict-maximum rule strictSampleRule collects 0 on n ≥ 1 identical point-mass distributions PMF.pure a, since every online value equals the sample maximum a.