Basic Constructions of Simulation Oracles #
This file defines a number of basic simulation oracles, as well as operations to combine them.
Given an implementation of spec
in terms of a new set of oracles spec'
,
and an implementation of spec'
in terms of arbitrary m
, implement spec
in terms of m
.
Equations
- so'∘ₛso = { impl := fun {α : Type ?u.60} (q : spec.OracleQuery α) => OracleComp.simulateQ so' (so.impl q) }
Instances For
Equations
- QueryImpl.«term_∘ₛ_» = Lean.ParserDescr.trailingNode `QueryImpl.«term_∘ₛ_» 65 65 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "∘ₛ") (Lean.ParserDescr.cat `term 66))
Instances For
Substitute an equivalent type for the state of a simulation oracle, by using the equivalence
to move back and forth between the states as needed.
This can be useful when operations such like simOracle.append
add on a state of type Unit
.
TODO: this should really exist on the StateT
level probably instead.
Equations
- so.equivState e = { impl := fun {α : Type ?u.64} (q : spec.OracleQuery α) (s : τ) => Prod.map id ⇑e <$> so.impl q (e.symm s) }
Instances For
Masking a Subsingleton
state has no effect, since the new state elements look the same.
Simulation oracle for replacing queries with uniform random selection, using unifSpec
.
The resulting computation is still identical under evalDist
.
The relevant OracleSpec
can usually be inferred automatically, so we leave it implicit.
Equations
- unifOracle = { impl := fun {α : Type} (x : spec.OracleQuery α) => match α, x with | .(spec.range i), OracleSpec.query i t => $ᵗspec.range i }