Documentation

CslibFrontier.Languages.Probabilistic.QueryCount.Congr

Oracles that agree on the calls a program makes #

If every call of a program satisfies p (OracleComp.QueriesSatisfy), two handlers that agree on the calls satisfying p interpret the program identically. For programs with private coins, the predicate constrains only the external requests, and the output laws of two runs agree when the two oracles have the same law on every request satisfying p.

Main results #

theorem Cslib.OracleComp.QueriesSatisfy.interpret_congr {ι : Type u} {spec : OracleSpec ι} {α : Type v} {m : Type v → Type w} [Monad m] [LawfulMonad m] {p : ι → Prop} {program : OracleComp spec α} (h : QueriesSatisfy p program) {handler handler' : (q : ι) → m (spec q)} (hagree : ∀ (q : ι), p q → handler q = handler' q) :
interpret handler program = interpret handler' program

Handlers that agree on every call satisfying p interpret a program whose calls all satisfy p identically.

theorem Cslib.ProbOracleComp.QueriesSatisfy.eval_run_congr {Query α : Type} {spec : Query → Type} {p : Query → Prop} {program : ProbOracleComp spec α} (h : QueriesSatisfy p program) {oracle oracle' : (q : Query) → ProbComp (spec q)} (hagree : ∀ (q : Query), p q → (oracle q).eval = (oracle' q).eval) :
(program.run oracle).eval = (program.run oracle').eval

Runs of a program whose external requests all satisfy p have the same output law under two oracles with the same law on every request satisfying p.