Skip to content

PapersPaper 0 · Preprint · 7 November 2026

Collaboration Is Composition: Mealy Machines over Signed Records in Poly and Org

Risav Karna, CoSys Work Pvt. Ltd.ORCID 0009-0005-6682-9473

Abstract

People, organisations and the software acting for them increasingly work together without a shared server and without an orchestrator: each party keeps its own record, and work moves between peers as signed messages. We argue that such collaboration is composition. Every party acts through a Mealy machine over an append-only log of signed records, and a collaboration is existing machines wired together through mailboxes, so a collaboration is itself a machine and can be wired into a larger one. We give a mechanized model of one such system, the model that our published libraries implement, with primitives from a research matrix we wrote in 2014 and from applied category theory. In the category of polynomial functors a mailbox turns each machine into a dynamical system, and wiring that changes as units pair becomes one map whose routing depends on the units’ positions. Held in a registry, the wiring carries the identitor and compositor of a dynamic organization in the sense of Shapiro and Spivak. Claims are types whose only inhabitants are records signed by the right keys, so an approval signed by an agent does not type-check. What composition gives follows from known results, applied to this model and checked in Lean 4. Bisimilar machines give bisimilar collaborations. When every machine is monotone in its log, logs and views converge under any fair delivery order, a form of the CALM theorem, and a step that is not monotone is where the model asks for a signature. Acceptance of a derived fact is a homomorphism out of a provenance semiring, and trust is a fibration over observers, with each ranking computed inside its observer’s fiber. A case study from health care, in which a patient routes lab results and payment requests between her clinic and her family, runs through the paper.

PDF, 20 pages, 252 KB. Free to share and adapt under CC BY 4.0.

How to cite it

Each version has its own DOI, so cite the one you read or ran.

The paper

Preprint. Free to share and adapt under CC BY 4.0.

Karna, R. (2026). Collaboration Is Composition: Mealy Machines over Signed Records in Poly and Org [Preprint]. Zenodo. https://doi.org/10.5281/zenodo.24026645

@misc{karna2026collaboration,
  author       = {Karna, Risav},
  title        = {{Collaboration Is Composition}: {Mealy} Machines over Signed Records in {Poly} and {Org}},
  year         = {2026},
  howpublished = {Preprint, Zenodo},
  doi          = {10.5281/zenodo.24026645},
  url          = {https://doi.org/10.5281/zenodo.24026645}
}

The Lean 4 proofs

Release proofs-v1.0.0 of our open-source libraries, under Apache 2.0.

Karna, R. (2026). cosys: packages and Lean 4 proofs for Collaboration Is Composition (Version proofs-v1.0.0) [Software]. Zenodo. https://doi.org/10.5281/zenodo.24026063

@misc{karna2026cosys,
  author       = {Karna, Risav},
  title        = {cosys: packages and {Lean} 4 proofs for {Collaboration Is Composition}},
  year         = {2026},
  howpublished = {Zenodo, release proofs-v1.0.0},
  doi          = {10.5281/zenodo.24026063},
  url          = {https://doi.org/10.5281/zenodo.24026063}
}

All papers