Coercing Computations to Larger Oracle Sets #
This file defines SubSpec instances for oracle specs constructed with
either OracleSpec.add or OracleSpec.sigma. Each instance spells out the
monadLift action explicitly (rather than letting it default from
onQuery / onResponse) so that the lifted query reduces fully under
isDefEq. This is load-bearing for rw / simp lemmas like
probEvent_liftComp to find their pattern through the synthesized
MonadLiftT instance chain.
We need Inhabited to prevent infinite type-class searching.
Add additional oracles to the right side of the existing ones.
Add additional oracles to the left side of the exiting ones.
Congruence on the left summand: an inclusion spec₁ ⊂ₒ spec₃ extends to
spec₁ + spec₂ ⊂ₒ spec₃ + spec₂.
Low priority so that searches whose source spec is a metavariable (notably the
MonadLiftT (OracleComp spec) (OracleComp superSpec) chain behind whole-computation
coercions) prefer the direct embeddings subSpec_add_left / subSpec_add_right. This keeps
such coercions a single liftComp, definitionally, instead of a stack of lifts through an
intermediate spec.
Congruence on the right summand: an inclusion spec₂ ⊂ₒ spec₃ extends to
spec₁ + spec₂ ⊂ₒ spec₁ + spec₃.
Low priority for the same reason as subSpec_left_add_left_add_of_subSpec: the direct
embeddings must win metavariable-headed searches so that whole-computation coercions stay a
single liftComp.