Documentation

CslibFrontier.Languages.Probabilistic.QueryCount.Sum

Call budgets of programs over one side of a sum #

A program over spec₁, embedded in spec₁ ⊕ₒ spec₂ by OracleComp.liftLeft, makes only left calls. A budget for its calls therefore bounds the embedded program under any cost on the sum that charges each left call at most its original cost (IsCostBounded.liftLeft); in particular, the embedded program makes no call that a cost charging nothing on the left counts. The same holds on the right (IsCostBounded.liftRight).

Main results #

theorem Cslib.OracleComp.IsCostBounded.liftLeft {ι₁ ι₂ : Type u} {spec₁ : OracleSpec ι₁} {spec₂ : OracleSpec ι₂} {α : Type v} {cost₁ : ι₁ → ℕ} {cost : ι₁ ⊕ ι₂ → ℕ} {program : OracleComp spec₁ α} {n : ℕ} (h : IsCostBounded cost₁ program n) (hcost : ∀ (q : ι₁), cost (Sum.inl q) ≤ cost₁ q) :
IsCostBounded cost program.liftLeft n

A budget n for a left program under cost₁ is a budget for its embedding under every cost on the sum charging each left call .inl q at most cost₁ q.

theorem Cslib.OracleComp.IsCostBounded.liftRight {ι₁ ι₂ : Type u} {spec₁ : OracleSpec ι₁} {spec₂ : OracleSpec ι₂} {α : Type v} {cost₂ : ι₂ → ℕ} {cost : ι₁ ⊕ ι₂ → ℕ} {program : OracleComp spec₂ α} {n : ℕ} (h : IsCostBounded cost₂ program n) (hcost : ∀ (q : ι₂), cost (Sum.inr q) ≤ cost₂ q) :
IsCostBounded cost program.liftRight n

A budget n for a right program under cost₂ is a budget for its embedding under every cost on the sum charging each right call .inr q at most cost₂ q.

theorem Cslib.OracleComp.IsCostBounded.liftLeft_of_cost_inl_eq_zero {ι₁ ι₂ : Type u} {spec₁ : OracleSpec ι₁} {spec₂ : OracleSpec ι₂} {α : Type v} {cost : ι₁ ⊕ ι₂ → ℕ} (hcost : ∀ (q : ι₁), cost (Sum.inl q) = 0) (program : OracleComp spec₁ α) :
IsCostBounded cost program.liftLeft 0

A left program makes no call that a cost charging nothing on the left counts.

theorem Cslib.OracleComp.IsCostBounded.liftRight_of_cost_inr_eq_zero {ι₁ ι₂ : Type u} {spec₁ : OracleSpec ι₁} {spec₂ : OracleSpec ι₂} {α : Type v} {cost : ι₁ ⊕ ι₂ → ℕ} (hcost : ∀ (q : ι₂), cost (Sum.inr q) = 0) (program : OracleComp spec₂ α) :
IsCostBounded cost program.liftRight 0

A right program makes no call that a cost charging nothing on the right counts.