← back to index

Towards Foundations of Categorical Cybernetics

Capucci, Gavranović, Hedges, Rischel · 2021 · arxiv arXiv:2105.06332

Prereqs: 🍞 Hedges 2018 (open games, selection functions). 5 min.

Goals are selection relations β€” predicates on (choice, context) pairs. An agent is a parametrised optic (forward pass + backward pass) with a selection relation Ξ΅(x, k) that says which choices x are acceptable given a context k : X β†’ R mapping alternatives to outcomes. Composing agents = composing optics = wiring forward and backward channels.

Optics β€” forward and backward

An optic pairs a forward map (observation β†’ action) with a backward map (action + consequence β†’ updated state). Think lens from functional programming: get/set. In cybernetics, the forward pass is "act" and the backward pass is "learn from consequences."

Lens A, going right --> S get / view A S', going left --> A' put / update S' forward: observe. backward: update from consequences.
Scheme

Parametrised optics β€” agents with tunable parameters

A parametrised optic adds parameters: the forward map depends on a parameter (policy/weights), and the backward map produces a parameter update. This is the agent abstraction. The parameter is what learning updates.

Para P parameters A --> S fwd(P, S) A S' --> A' bwd S' parameter P controls the forward pass. backward pass updates the agent.
Scheme

Selection relations β€” goals as two-place predicates

In Hedges 2018, a selection function picks the best action. Capucci generalizes to a selection relation: Ξ΅ βŠ† X Γ— (X β†’ R), a predicate on (choice, context) pairs. The context k : X β†’ R maps every alternative choice to its outcome β€” so Ξ΅(x, k) means "x is acceptable given what the alternatives would yield." Not "the best action" but "any action that's good enough, relative to the landscape of alternatives."

Scheme

Confidence: Simplified. Real selection relations live on parametrised optics in a monoidal category, with the context k derived from the optic's backward channel. Same two-place predicate structure.

Composing agents β€” wiring optics

Two parametrised optics compose by wiring: agent 1's forward output feeds agent 2's forward input (the action becomes the observation), and agent 2's backward output feeds agent 1's backward input (consequences flow back). The whole system satisfies the composite goal when each agent satisfies its local goal given the context the other provides.

Scheme

Goals compose via the Nash product

The paper's composition theorem for goals is the Nash product Ξ΅ ⊠ Ξ΄: agents x and y are jointly acceptable iff each is acceptable given the other's choice as context. This is the paper's actual claim. The bridge to Staton's Hoare logic β€” goals as postconditions, composition via COMP β€” is an editorial connection, not something Capucci et al. prove. But the structural parallel is real: in both cases, a global goal decomposes into local goals at an interface.

Scheme

Confidence: Editorial analogy. The Hoare triple parallel is mine, not the paper's. The paper composes goals via the Nash product (Ρ ⊠ δ). The sequential-postcondition framing comes from Staton 2025.

Notation reference

Paper Scheme Meaning
Optic(S,A; S',A')(make-optic name fwd bwd)Forward + backward pair
Para(C)(make-para-optic ...)Parametrised optic
Ξ΅ βŠ† X Γ— (X β†’ R)(satisfies? goal action ctx)Selection relation β€” goal as (choice, context) predicate
G₁ ; Gβ‚‚(compose-optics o1 o2)Sequential composition
argmaxX(lambda (x k) (max? x k))Canonical selection relation: x maximizes k
Ρ ⊠ δ# Nash productComposed goal: both agents satisfied given each other's choice
Neighbors

Other paper pages

Related foundations

Foundations (Wikipedia)

Translation notes

All examples use plain functions for optics and simple predicates for goals. The paper works with parametrised optics in a symmetric monoidal category, selection relations as profunctors, and a formal composition theorem for goals over mixed optics. For example: the agent composition on this page wires two functions sequentially. In the paper, the same construction works over a monoidal category of parametrised optics where the forward and backward channels live in different categories (the "mixed" in mixed optics), enabling agents whose learning substrate differs from their action space. The composition pattern is identical. The categorical scaffolding is not.

Ready for the real thing? arxiv Read the paper. Start at Β§3 for parametrised optics, Β§4 for selection relations and goals.

Framework connection: The Natural Framework pipeline is a composed cybernetic system: agent composition via parametrised optics is its core structural pattern. (jkThe Handshake, jkThe Natural Framework)