Documentation

CslibFrontier.Languages.Probabilistic.UntilBad.TwoCost

Accumulating bad-event probability with two query costs #

A stateful oracle may have two independently bounded kinds of calls, where each channel can charge against its own growing bad-event budget (toOuterMeasure_bad_le_two_budgets), or where one channel charges against a growing budget and the other charges a fixed error (toOuterMeasure_bad_le_two). This extends the single-cost bound in CslibFrontier/Languages/Probabilistic/UntilBad.lean without introducing a cryptographic protocol dependency.

Main results #

theorem Cslib.OracleComp.toOuterMeasure_bad_le_two_budgets {ι σ β : Type} {spec : ι → Type} {handler : (q : ι) → StateT σ PMF (spec q)} {bad : σ → Prop} (cost₁ cost₂ : ι → ℕ) (budget₁ budget₂ : σ → ENNReal) (δ₁₁ δ₁₂ δ₂₁ δ₂₂ : ENNReal) (hstep : ∀ (q : ι) (s : σ), ¬bad s → (handler q s).toOuterMeasure {x : spec q × σ | bad x.2} ≤ ↑(cost₁ q) * budget₁ s + ↑(cost₂ q) * budget₂ s) (hgrow₁ : ∀ (q : ι) (s : σ), ¬bad s → ∀ x ∈ (handler q s).support, ¬bad x.2 → budget₁ x.2 ≤ budget₁ s + ↑(cost₁ q) * δ₁₁ + ↑(cost₂ q) * δ₁₂) (hgrow₂ : ∀ (q : ι) (s : σ), ¬bad s → ∀ x ∈ (handler q s).support, ¬bad x.2 → budget₂ x.2 ≤ budget₂ s + ↑(cost₁ q) * δ₂₁ + ↑(cost₂ q) * δ₂₂) {program : OracleComp spec β} {k₁ k₂ : ℕ} (hk₁ : IsCostBounded cost₁ program k₁) (hk₂ : IsCostBounded cost₂ program k₂) {s : σ} (hs : ¬bad s) :
((interpret handler program).run s).toOuterMeasure {x : β × σ | bad x.2} ≤ ↑k₁ * (budget₁ s + ↑k₁ * δ₁₁ + ↑k₂ * δ₁₂) + ↑k₂ * (budget₂ s + ↑k₁ * δ₂₁ + ↑k₂ * δ₂₂)

Two-channel accumulated bad-state probability with two growing budgets: let each call q from a good state ¬bad s turn bad with probability at most cost₁ q * budget₁ s + cost₂ q * budget₂ s, raising budget₁ by at most cost₁ q * δ₁₁ + cost₂ q * δ₁₂ and budget₂ by at most cost₁ q * δ₂₁ + cost₂ q * δ₂₂. Then a program with IsCostBounded cost₁ program k₁ and IsCostBounded cost₂ program k₂, started in a good state s, ends in a bad state with probability at most k₁ * (budget₁ s + k₁ * δ₁₁ + k₂ * δ₁₂) + k₂ * (budget₂ s + k₁ * δ₂₁ + k₂ * δ₂₂).

theorem Cslib.OracleComp.toOuterMeasure_bad_le_two {ι σ β : Type} {spec : ι → Type} {handler : (q : ι) → StateT σ PMF (spec q)} {bad : σ → Prop} (cost₁ cost₂ : ι → ℕ) (budget : σ → ENNReal) (δ₁ δ₂ ε : ENNReal) (hstep : ∀ (q : ι) (s : σ), ¬bad s → (handler q s).toOuterMeasure {x : spec q × σ | bad x.2} ≤ ↑(cost₁ q) * budget s + ↑(cost₂ q) * ε) (hgrow : ∀ (q : ι) (s : σ), ¬bad s → ∀ x ∈ (handler q s).support, ¬bad x.2 → budget x.2 ≤ budget s + ↑(cost₁ q) * δ₁ + ↑(cost₂ q) * δ₂) {program : OracleComp spec β} {k₁ k₂ : ℕ} (hk₁ : IsCostBounded cost₁ program k₁) (hk₂ : IsCostBounded cost₂ program k₂) {s : σ} (hs : ¬bad s) :
((interpret handler program).run s).toOuterMeasure {x : β × σ | bad x.2} ≤ ↑k₁ * (budget s + ↑k₁ * δ₁ + ↑k₂ * δ₂) + ↑k₂ * ε

Two-channel accumulated bad-state probability: let each call q from a good state ¬bad s turn bad with probability at most cost₁ q * budget s + cost₂ q * ε, and raise budget by at most cost₁ q * δ₁ + cost₂ q * δ₂. Then a program with IsCostBounded cost₁ program k₁ and IsCostBounded cost₂ program k₂, started in a good state s, ends in a bad state with probability at most k₁ * (budget s + k₁ * δ₁ + k₂ * δ₂) + k₂ * ε.