Specifications of Available Oracles #
This file defines a type OracleSpec
to represent a set of available oracles.
The available oracles are all indexed by some (potentially infinite) indexing set ι
,
and for each index i
a pair of types domain i
and range i
.
We also define a number of basic oracle constructions:
A structure to represents a specification of oracles available to a computation.
The available oracles are all indexed by some (potentially infinite) indexing set ι
.
Represented as a map from indices i
to the domain and codomain of the corresponding oracle.
Equations
- OracleSpec ι = (ι → Type ?u.12 × Type ?u.12)
Instances For
Equations
- OracleSpec.instInhabited = { default := fun (x : ι) => (PUnit.{?u.12 + 1}, PUnit.{?u.12 + 1}) }
Type of the domain for calls to the oracle corresponding to i
.
Instances For
Type of the range for calls to the oracle corresponding to i
.
Instances For
Typeclass to capture decidable equality of the oracle input and outputs.
Needed for things like finSupport
to be well defined.
- domain_decidableEq' (i : ι) : DecidableEq (spec.domain i)
- range_decidableEq' (i : ι) : DecidableEq (spec.range i)
Instances
Typeclass for specs where each oracle has a finite and non-empty output type.
Needed for things like evalDist
and probOutput
.
Instances
spec₁ ++ spec₂
combines the two sets of oracles disjointly using Sum
for the indexing set.
inl i
is a query to oracle i
of spec
, and inr i
for oracle i
of spec'
.
Instances For
Equations
- OracleSpec.«term_++ₒ_» = Lean.ParserDescr.trailingNode `OracleSpec.«term_++ₒ_» 65 65 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ++ₒ ") (Lean.ParserDescr.cat `term 66))
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Reduce the indexing set by pulling back along some map f
.
Instances For
Access to no oracles, represented by an empty indexing set.
We take the domain and range to be PUnit
(rather than e.g. empty.elim i
),
which often gives better behavior for proofs even though the oracle is never called.
Equations
Instances For
Equations
- «term[]ₒ» = Lean.ParserDescr.node `«term[]ₒ» 1024 (Lean.ParserDescr.symbol "[]ₒ")
Instances For
Equations
Equations
Equations
- instDecidableEqPEmptyEmptySpec = { domain_decidableEq' := inferInstance, range_decidableEq' := inferInstance }
Equations
- instFiniteRangePEmptyEmptySpec = { range_inhabited' := inferInstance, range_fintype' := inferInstance }
T →ₒ U
represents a single oracle, with domain T
and range U
.
Uses the singleton type PUnit
as the indexing set.
Instances For
Equations
- «term_→ₒ_» = Lean.ParserDescr.trailingNode `«term_→ₒ_» 25 25 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " →ₒ ") (Lean.ParserDescr.cat `term 26))
Instances For
Equations
- instDecidableEqPUnitSingletonSpecOfDecidableEq = { domain_decidableEq' := inferInstance, range_decidableEq' := inferInstance }
Equations
- instFiniteRangePUnitSingletonSpecOfInhabitedOfFintype = { range_inhabited' := inferInstance, range_fintype' := inferInstance }
Equations
- instDecidableEqUnitCoinSpec = { domain_decidableEq' := inferInstance, range_decidableEq' := inferInstance }
Equations
- instFiniteRangeUnitCoinSpec = { range_inhabited' := inferInstance, range_fintype' := inferInstance }
Equations
- instDecidableEqNatUnifSpec = { domain_decidableEq' := inferInstance, range_decidableEq' := inferInstance }
Equations
- instFiniteRangeNatUnifSpec = { range_inhabited' := inferInstance, range_fintype' := inferInstance }