Coercions Between Computations With Additional Oracles #
This file defines a isSubSpec
relation for pairs of oracleSpec
where one can be
thought of as an extension of the other with additional oracles.
The definition consists is a thin wrapper around a MonadLift
instance on OracleQuery
,
which extends to a lifting operation on OracleComp
.
We use the notation spec ⊂ₒ spec'
to represent that one set of oracles is a subset of another,
where the non-inclusive subset symbol reflects that we avoid defining this instance reflexively.
Relation defining an inclusion of one set of oracles into another, where the mapping
doesn't affect the underlying probability distribution of the computation.
Informally, spec ⊂ₒ superSpec
means that for any query to an oracle of sub_spec
,
it can be perfectly simulated by a computation using the oracles of superSpec
.
We avoid implementing this via the built-in subset notation as we care about the actual data of the mapping rather than just its existence, which is needed when defining type coercions.
Instances
Equations
- OracleSpec.«term_⊂ₒ_» = Lean.ParserDescr.trailingNode `OracleSpec.«term_⊂ₒ_» 50 51 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ⊂ₒ ") (Lean.ParserDescr.cat `term 51))
Instances For
Lift a computation from spec
to superSpec
using a SubSpec
instance on queries.
Equations
- oa.liftComp superSpec = OracleComp.simulateQ { impl := fun {α : Type ?u.14} => liftM } oa
Instances For
Lifting a computation to a different set of oracles doesn't change the output distribution,
since evalDist
assumes uniformly random queries.
Extend a lifting on OracleQuery
to a lifting on OracleComp
.
Equations
- OracleComp.instMonadLiftOfOracleQuery = { monadLift := fun {α : Type ?u.45} (oa : OracleComp spec α) => oa.liftComp superSpec }