Documentation

CslibFrontier.Languages.Probabilistic.UntilBad.ChooseTwo

Triangular union bounds for linearly growing bad-event sets #

When each oracle call from a good state s triggers a bad state with probability proportional to an integer state size size s (size s * δ) and grows size by at most 1 per call, summing over an n-query adaptive execution yields the triangular birthday sum size s + (size s + 1) + ⋯ + (size s + n - 1) = n * size s + n.choose 2 rather than the rectangular bound n * (size s + n) of OracleComp.toOuterMeasure_bad_le.

More generally (toOuterMeasure_bad_choose_two_cost_le), when calls carry two separate cost budgets cost₁ (charging bad-event probability (cost₁ q * size s + (cost₁ q).choose 2) * δ and growing size) and cost₂ (growing size without risking a bad transition, such as passive random-oracle queries alongside programming steps), an adaptive program with budgets k₁ and k₂ reaches a bad state with probability at most (k₁ * size s + k₁ * k₂ + k₁.choose 2) * δ. The per-call term (cost₁ q).choose 2 charges collisions among the cost₁ q points a single call adds, as when one block-mode encryption samples a whole chain.

Main results #

theorem Cslib.OracleComp.toOuterMeasure_bad_choose_two_cost_le {ι σ α : Type} {spec : ι → Type} {handler : (q : ι) → StateT σ PMF (spec q)} {bad : σ → Prop} (cost₁ cost₂ : ι → ℕ) (size : σ → ℕ) (δ : ENNReal) (hstep : ∀ (q : ι) (s : σ), ¬bad s → (handler q s).toOuterMeasure {x : spec q × σ | bad x.2} ≤ ↑(cost₁ q * size s + (cost₁ q).choose 2) * δ) (hgrow : ∀ (q : ι) (s : σ), ¬bad s → ∀ x ∈ (handler q s).support, ¬bad x.2 → size x.2 ≤ size 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₁ * size s + k₁ * k₂ + k₁.choose 2) * δ

Two-cost triangular accumulated probability of a bad state. Suppose each call q from a good state s (¬bad s) turns bad with probability at most (cost₁ q * size s + (cost₁ q).choose 2) * δ, and every good supported transition increases size by at most cost₁ q + cost₂ q. Then any adaptive program satisfying IsCostBounded cost₁ program k₁ and IsCostBounded cost₂ program k₂ reaches a bad state from s with probability at most (k₁ * size s + k₁ * k₂ + k₁.choose 2) * δ.

theorem Cslib.OracleComp.toOuterMeasure_bad_choose_two_of_isCostBounded {ι σ α : Type} {spec : ι → Type} {handler : (q : ι) → StateT σ PMF (spec q)} {bad : σ → Prop} (cost : ι → ℕ) (size : σ → ℕ) (δ : ENNReal) (hstep : ∀ (q : ι) (s : σ), ¬bad s → (handler q s).toOuterMeasure {x : spec q × σ | bad x.2} ≤ ↑(cost q * size s + (cost q).choose 2) * δ) (hgrow : ∀ (q : ι) (s : σ), ¬bad s → ∀ x ∈ (handler q s).support, ¬bad x.2 → size x.2 ≤ size s + cost q) {program : OracleComp spec α} {n : ℕ} (hn : IsCostBounded cost program n) {s : σ} (hs : ¬bad s) :
((interpret handler program).run s).toOuterMeasure {x : α × σ | bad x.2} ≤ ↑(n * size s + n.choose 2) * δ

Cost-weighted triangular accumulated probability of a bad state. Suppose each call q from a good state s turns bad with probability at most (cost q * size s + (cost q).choose 2) * δ and increases size by at most cost q. Then a program with IsCostBounded cost program n reaches a bad state from s with probability at most (n * size s + n.choose 2) * δ.

theorem Cslib.OracleComp.toOuterMeasure_bad_choose_two_le {ι σ α : Type} {spec : ι → Type} {handler : (q : ι) → StateT σ PMF (spec q)} {bad : σ → Prop} (size : σ → ℕ) (δ : ENNReal) (hstep : ∀ (q : ι) (s : σ), ¬bad s → (handler q s).toOuterMeasure {x : spec q × σ | bad x.2} ≤ ↑(size s) * δ) (hgrow : ∀ (q : ι) (s : σ), ¬bad s → ∀ x ∈ (handler q s).support, ¬bad x.2 → size x.2 ≤ size s + 1) {program : OracleComp spec α} {n : ℕ} (hn : program.IsQueryBounded n) {s : σ} (hs : ¬bad s) :
((interpret handler program).run s).toOuterMeasure {x : α × σ | bad x.2} ≤ ↑(n * size s + n.choose 2) * δ

Triangular accumulated probability of a bad state. If each oracle call from a good state s turns bad with probability at most size s * δ and increases size by at most 1, then an adaptive program making at most n queries reaches a bad state from s with probability at most (n * size s + n.choose 2) * δ.