refactor(interaction): let the observation carry the UC factorization laws - #121
Open
dtumad wants to merge 3 commits into
Open
refactor(interaction): let the observation carry the UC factorization laws#121dtumad wants to merge 3 commits into
dtumad wants to merge 3 commits into
Conversation
… laws The UC composition theorems previously required `OpenTheory.HasPlugWireFactor`, a strict compact-closed structure that the process-backed `openTheory` cannot supply: every binary composition prepends a scheduler node, so regrouping one is a delay bisimulation rather than an identity. State the same motions as properties of the observation instead, through `Observation.RespectsPlugComm` and `Observation.RespectsFactorization`. Strict coherence is the degenerate case, so the free syntax models are unaffected, and a model that can only offer a scheduling-insensitive observation now participates: `Emulates.plug_right` and `Emulates.plug_compose` apply to `openTheory` for the first time. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 8, 2026
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Observation.RespectsPlugCommandObservation.RespectsFactorization, stating plug commutation and the fourclose_*factorizations up toObs.relinstead of as strict equalitiesrespectsFactorization_of_hasPlugWireFactor, so any observation over aHasPlugWireFactortheory satisfies both classes by reflexivityEmulates.{par_left, par_right, par_compose, wire_left, wire_right, wire_compose}againstRespectsFactorization, andEmulates.{plug_right, plug_compose}against the weakerRespectsPlugCommInteraction/UC/OpenProcessEmulates.leanwithObservation.IsSchedulingInsensitiveand theRespectsPlugComminstance it yields foropenTheoryPolyFunTest/Interaction/UC/EmulatesFactorizationExamples.leanWhy
Emulates' composition theorems were gated onOpenTheory.HasPlugWireFactor. The free syntax models instantiate that; the process-backedopenTheorycannot, becausepar/wire/plugeach prepend a scheduler node, so reassociating a composite changes the step tree's type and the laws hold only up toOpenProcessActivationEquiv.Emulates.leansaid as much in prose — "those theorems do not apply to it directly" — and worked around it for one law with the_of_observes_plug_commvariants.This generalizes that workaround from one law to all of them. The laws are the same; what changes is who is asked to supply them. A theory with strict coherence supplies them by
rfl, so nothing that held before stops holding. A model that can only offer an observation coarse enough not to see scheduler nodes now supplies them too, andEmulates.plug_right/plug_composereachopenTheoryfor the first time.Worth noting explicitly:
Emulates · · Obs, read as a family indexed by boundary, is already closed under exactly these motions —par_composeandwire_leftare the parallel and sequential closure conditions one would assume of an abstract indistinguishability relation. The classes make that closure the interface rather than a consequence of strictness. This is the same split used in the categorical treatment of UC in ePrint 2026/1605, which assumes those two conditions and derives the composition theorems from them.Deliberately excluded.
RespectsFactorizationforopenTheory— thepar/wirehalf — is not here. It needs activation-equivalence versions ofplug_par_leftandplug_wire_left, which do not exist yet (nor do any of the threeIsTracedlaws that would be the categorical route to them). The module docstring records this and it is the subject of a follow-up. The class is also deliberately not an extension ofIsCompactClosed:openTheoryhas neither aHasUnitnor aHasIdWireinstance, and requiring them would put the class out of its reach for no gain.API change.
Emulates.plug_right_of_observes_plug_commandEmulates.plug_compose_of_observes_plug_commare removed;RespectsPlugCommsubsumes them. Callers holding the old bare hypothesis migrate withhaveI : Obs.RespectsPlugComm := ⟨hcomm⟩. There are no in-tree callers, and VCVio does not consumeEmulatesat all — itsInteraction/UC/Computational.leancarries its own copy of the suite — so nothing downstream breaks.Validation
./scripts/validate.sh --lint --testPolyFunTestbuild, import and documentation integrity checksExpr.theorystill resolvesRespectsFactorizationby synthesis and still elaboratespar_compose,wire_compose, andplug_compose(covered by the new test file)docs/wiki/interaction.mdUC table anddocs/wiki/repo-map.mdlayering updated for the new module