Documentation

VCVio.OracleComp.HasQuery.Morphism

Morphisms of HasQuery Monads #

This module contains the heavier HasQuery naturality layer. It imports ProbComp and monad homomorphisms, so files that only need the basic query capability should import VCVio.OracleComp.HasQuery.Basic instead.

Use this module for proofs that a monad morphism preserves oracle queries, or that it commutes with the canonical lift of public randomness.

structure HasQuery.QueryHom {ι : Type u} (spec : OracleSpec ι) (m : Type v → Type w) [Monad m] [HasQuery spec m] (n : Type v → Type x) [Monad n] [HasQuery spec n] extends m →ᵐ n :
Type (max (max (v + 1) w) x)

A QueryHom spec m n is a monad morphism m →ᵐ n that also preserves the distinguished oracle-query capability for spec. This is the right notion of morphism for proving that a construction generic over HasQuery spec is natural in the chosen oracle semantics.

Instances For

    A monad morphism preserves public randomness when it commutes with the distinguished lifting of plain probabilistic computations into the ambient monad.

    Instances For
      @[simp]
      theorem HasQuery.map_query {ι : Type u} {spec : OracleSpec ι} {m : Type v → Type w} [Monad m] [HasQuery spec m] {n : Type v → Type x} [Monad n] [HasQuery spec n] (F : QueryHom spec m n) (t : spec.Domain) :
      (fun {α : Type v} (x : m α) => F.toFun α x) (query t) = query t