definition example theorem proof

Let be a Symmetric Monoidal Category and an object. A dual for consists of

(i) an object , the dual of ; (ii) a morphism , the unit (drawn as a cup); (iii) a morphism , the counit (a cap),

satisfying the snake equations (zig-zag identities):

and symmetrically is . If every object has a dual, is compact closed.

Sources: 7 Sketches §4.5 (Definition 4.58, Eq. 4.59, Proposition 4.60, Examples 4.61, Theorem 4.63, Exercises 4.62, 4.64–4.66), §4.1 (Eq. 4.1), §6.6; DaoFP §15.1 (string diagrams: cups and caps for adjunctions), §19.1; [Sel10]; St Clere Smithe & Perin arXiv:2503.18608 (notes) Remark 8, Example 4.

Wiring diagrams with feedback

In a compact closed category wires carry a direction: a forward wire labelled equals a backward wire labelled . The cup and cap let any wire reverse direction, so outputs can be bent into inputs — the feedback loops of Co-design diagrams (Eq. 4.1: the chassis carries the weight of the motor that powers it) and of Eq. 4.55–4.57 (“Person 1” emits sound and fury, “Person 2” receives sound and emits a complaint; bending the fury wire back). The snake equations say a zig-zag wire can be straightened. “This same structure shows up in quantum mechanics and dynamical systems.”

c¤c"c(cap)c¤c´c(cup)=snakeequationc¤c"c(cap)c¤c´c(cup)=snakeequation

Examples

  • and (Theorem 4.63): is the product of -categories, , , and — “the unit and counit look like identities” (7S Exercise 4.66). This is what “puts actual mathematics behind” co-design diagrams: a resource required can be read as a resource provided in the opposite preorder.
  • (Example 4.61): finite sets and corelations (equivalence relations on ), monoidal under , every set self-dual with and both the “pairing” equivalence relation (7S Exercise 4.62).
  • with the dual space, the identity tensor and evaluation — the origin of the name; with or ; and every Hypergraph Category (each object self-dual via the Frobenius cup and cap).
  • with is not compact closed (a set with more than one element has no dual), though it is cartesian closed.

Proposition 4.60

If is compact closed then (1) is monoidal closed with and the isomorphism given by precomposing with (and using the snake equations for the inverse); (2) duals are unique up to isomorphism; (3) . Compact closed categories are thus a special kind of closed monoidal category, hence the name; in the internal hom is the preorder whose elements are exactly the pairs in a feasibility relation. DaoFP’s string diagrams for adjunctions use the same cups/caps: an adjunction is a “dual pair” of 1-cells in the 2-category .

Open models: cups clamp data

In the AutoBayes framework, open models with copiers, cups and (unnormalised) caps form a self-dual compact closed bicategory (St Clere Smithe & Perin, Remark 8). A cup bends an unobserved leg into an observed one: composing after makes both inputs and outputs observed, which is supervised learning — clamping labels to data (Example 4). Wires can be bent around, so a model no longer has a fixed input/output direction, and feedback loops (cyclic models) become expressible — at the price of unnormalised measures. Compact closure bends one wire at a time; wiring an arbitrary graph, where a variable meets factors, needs the stronger structure of a Hypergraph Category.

Docs: Theories & presentations

# Catlab: the GAT of compact closed categories, with duals, units (cups) and counits (caps)
using Catlab
@present CC(FreeCompactClosedCategory) begin
  (A, B)::Ob
  f::Hom(A, B)
end
A, B, f = CC[:A], CC[:B], CC[:f]
dual(A)                                    # A*
dunit(A)                                   # η_A : I → A* ⊗ A
dcounit(A)                                 # ε_A : A ⊗ A* → I
mate(f)                                    # the transpose B* → A*, built from η_A and ε_B
#check CategoryTheory.ExactPairing        -- (X Y : C): coevaluation η : 𝟙_C ⟶ X ⊗ Y, evaluation ε : Y ⊗ X ⟶ 𝟙_C, zig-zag laws
#check CategoryTheory.HasLeftDual
#check CategoryTheory.RightRigidCategory  -- every object has a right dual
#check CategoryTheory.RigidCategory       -- both duals: compact closed when symmetric
-- a dual pair in a monoidal category: cup and cap satisfying the snake equations (unenforced)
data DualPair c c' = DualPair
  { cup :: () -> (c', c)       -- η_c : I → c* ⊗ c   (only meaningful in a linear/ finite setting)
  , cap :: (c, c') -> ()       -- ε_c : c ⊗ c* → I
  }
-- Hask with (,) is not compact closed; FinVect-style duals live in linear-algebra libraries