feat(interaction): plug factorization for the process model up to activation equivalence - #124
Open
dtumad wants to merge 3 commits into
Open
Conversation
…ivation equivalence `Observation.RespectsFactorization` had no instance for `openTheory`: of the three `OpenTheory.HasPlugWireFactor` fields only `plug_eq_wire` had an activation-equivalence counterpart, and none of the three `IsTraced` laws that would be the categorical route to the others did either. Prove all four factorization laws directly as `of_step_match` bisimulations, in the established style of `openTheory_par_assoc_activation_equiv`. Each is a re-encoding of a two-bit scheduler path as a one-bit one; the scheduler nodes being moved are `.internal`, hence never activated, so the delay bisimulation absorbs them. The `_right` variants are proved directly rather than derived from the `_left` ones, which would need activation equivalence to be a congruence for `plug` — not currently available. The process model now satisfies the same interface as the free syntax models, so `Emulates.par_compose` and `wire_compose` apply to it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Collaborator
Author
|
Note on CI: |
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.
Stacked on #121 — review that first; this PR's base is its branch. Closes #123.
Summary
Interaction/UC/OpenProcessFactorization.leanwith the four factorization laws foropenTheoryup toOpenProcessActivationEquiv:openTheory_plug_{par,wire}_{left,right}_activation_equivopenTheory_plug_par_left_activation_equivand its siblings into that module rather than growingOpenProcessModel.leanpast the 1500-line cap (it stays at its current 971 lines)respectsFactorization_of_isSchedulingInsensitive, completing the instance story begun in refactor(interaction): let the observation carry the UC factorization laws #121EmulatesFactorizationExamples.leanwithpar_composeandwire_composeon the process modelWhy
#121 made the composition theorems depend on the observation rather than on strict compact-closed structure, but
openTheorycould still only satisfy the weakerRespectsPlugComm. Theparandwirehalf needed activation-equivalence versions ofplug_par_leftandplug_wire_left, which did not exist — and neither did any of the threeIsTracedlaws that would be the categorical route to them.So they are proved directly, as
OpenProcessActivationEquiv.of_step_matchbisimulations in the established style ofopenTheory_par_assoc_activation_equiv. In each case the state relation is a regrouping of the nested product of component states, and the four step obligations re-encode a two-bit scheduler path as a one-bit one. What makes this work is that the scheduler nodes being moved are.internal, soisActivatedis false andactivationLTSlabels them silent — the delay bisimulation absorbs exactly the nodes the regrouping introduces or removes.The
_rightvariants are proved directly rather than derived from the_leftones. The strict proofs ofclose_par_right/close_wire_rightrewrite underplugusingpar_comm/wire_comm, which needs activation equivalence to be a congruence forplug; no such lemma exists, andwire_commhas no activation-equivalence version either. Aplug-congruence lemma would be independently useful and would shorten this file, but it is a separate piece of work.The payoff is that the concrete, probability-carrying model now meets the same interface as the free syntax models, so
Emulates.par_composeandEmulates.wire_composeapply to it — which is the general validation that #121's design actually works, not just on the models that already had strict coherence.Deliberately excluded. No
IsTracedorIsCompactClosedinstance foropenTheory; those laws remain unproved for this model and are not needed here. No probability — that stays downstream in VCVio, per the scope boundary.Validation
./scripts/validate.sh --lint --testPolyFunTestbuild, import and documentation integrity checksObs.RespectsFactorizationresolves by synthesis foropenTheory, andpar_compose/wire_composeelaborate against it (new examples in the test file)OpenProcessFactorization.lean916,OpenProcessModel.lean971,OpenProcessEmulates.lean127docs/wiki/interaction.mdUC table anddocs/wiki/repo-map.mdlayering updated for the new module