Denotational Semantics for Output Distributions #
This file gives definitions for the output distribution or computations with uniform oracles.
Given a computation oa : OracleComp spec α
we define a distribution evalDist oa : PMF α
expressing the probability of getting an output x : α
if the oracles in spec
were to
respond uniformly to all queries.
We also define functions probOutput oa x
and probEvent oa p
for the probabilities of a
specific output of of a specific predicate holding on the output respectively.
We introduce notation [= x | oa]
and [p | oa]
for these defintions as well.
λ α ↦ (α → β)
The behavior of more complex oracles should first be implemented using OracleComp.simulate
before applying these constructions.
These definitons are compatible with OracleComp.support
and OracleComp.finSupport
in the sense
that values are in the support iff they have non-zero probability under evalDist
.
We give many simp lemmas involving tsum
a lower priority, as otherwise the simplifier will
always choose them over versions involving sum
(as they require DecidableEq
or Fintype
)
Equations
- oa.evalDistWhen query_dist = OracleComp.simulateQ { impl := fun {α : Type ?u.52} => query_dist } oa
Instances For
Associate a probability mass function to a computation, where the probability is the odds of
getting a given output assuming all oracles responded uniformly at random.
Implemented by simulating queries in the PMF
monad.
Equations
- One or more equations did not get rendered due to their size.
Instances For
[= x | oa]
is the probability of getting the given output x
from the computation oa
,
assuming all oracles respond uniformly at random.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
[⊥ | oa]
is the probability of the computation oa
failing.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
[p | oa]
is the probability of getting a result that satisfies a predicate p
after running the computation oa
, assuming all oracles respond uniformly at random.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
More explicit form of probEvent_eq_tsum_indicator
when the predicate p
is decidable.
An output has non-zero probability iff it is in the support
of the computation.
Alias of the forward direction of OracleComp.mem_support_evalDist_iff
.
An output has non-zero probability iff it is in the support
of the computation.
Alias of the reverse direction of OracleComp.mem_support_evalDist_iff
.
An output has non-zero probability iff it is in the support
of the computation.
An output has non-zero probability iff it is in the finSupport
of the computation.
Alias of the forward direction of OracleComp.mem_support_evalDist_iff'
.
An output has non-zero probability iff it is in the finSupport
of the computation.
Alias of the reverse direction of OracleComp.mem_support_evalDist_iff'
.
An output has non-zero probability iff it is in the finSupport
of the computation.
Alias of the reverse direction of OracleComp.probOutput_eq_zero_iff
.
Alias of the forward direction of OracleComp.probOutput_eq_zero_iff
.
Alias of the reverse direction of OracleComp.zero_eq_probOutput_iff
.
Alias of the forward direction of OracleComp.probOutput_eq_zero_iff
.
Alias of the reverse direction of OracleComp.probOutput_eq_zero_iff
.
Alias of the reverse direction of OracleComp.zero_eq_probOutput_iff'
.
Alias of the forward direction of OracleComp.probEvent_eq_zero_iff
.
Alias of the reverse direction of OracleComp.probEvent_eq_zero_iff
.
Alias of the reverse direction of OracleComp.zero_eq_probEvent_iff
.
Alias of the forward direction of OracleComp.probEvent_eq_zero_iff'
.
Alias of the reverse direction of OracleComp.probEvent_eq_zero_iff'
.
Alias of the reverse direction of OracleComp.zero_eq_probEvent_iff'
.
Alias of the reverse direction of OracleComp.probOutput_pos_iff
.
Alias of the forward direction of OracleComp.probOutput_pos_iff
.
Alias of the reverse direction of OracleComp.probOutput_pos_iff'
.
Alias of the forward direction of OracleComp.probOutput_pos_iff'
.
Alias of the reverse direction of OracleComp.probEvent_pos_iff
.
Alias of the forward direction of OracleComp.probEvent_pos_iff
.
Alias of the reverse direction of OracleComp.probEvent_pos_iff'
.
Alias of the forward direction of OracleComp.probEvent_pos_iff'
.
Alias of the reverse direction of OracleComp.probOutput_eq_one_iff
.
Alias of the reverse direction of OracleComp.one_eq_probOutput_iff
.
Alias of the reverse direction of OracleComp.probOutput_eq_one_iff'
.
Alias of the reverse direction of OracleComp.one_eq_probOutput_iff'
.
Alias of the reverse direction of OracleComp.probEvent_eq_one_iff
.
Alias of the reverse direction of OracleComp.probEvent_eq_one_iff
.
Alias of the reverse direction of OracleComp.probEvent_eq_one_iff'
.
Alias of the reverse direction of OracleComp.one_eq_probEvent_iff'
.
If p
implies q
on the support
of a computation then it is more likely to happen.
If p
implies q
on the finSupport
of a computation then it is more likely to happen.
The probability of an event written as a sum over the set {x | p x}
viewed as a subtype.
This notably doesn't require decidability of the predicate p
unlike many other lemmas.
Version probEvent_eq_tsum_subtype
that preemptively filters out elements that
aren't in the support, since they will have no mass contribution anyways.
This can make some proofs simpler by handling things on the level of subtypes.
Version of probOutput_bind_eq_tsum
that sums only over the subtype given by the support
of the first computation. This can be useful to avoid looking at edge cases that can't actually
happen in practice after the first computation. A common example is if the first computation
does some error handling to avoids returning malformed outputs.
Version of probFailure_bind_le_of_forall
with the 1 - s
factor ommited for convenience.
Version of probFailure_bind_le_of_forall
when oa
never fails.
Write the probability of an output after mapping the result of a computation as a sum over all outputs such that they map to the correct final output, using subtypes. This lemma notably doesn't require decidable equality on the final type, unlike most lemmas about probability when mapping a computation.
If pre-condition P
holds fox x
then comp x
satisfies
post-contdition Q
with probability at least r
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ⋯ = ⋯