definition example theorem

Let be a -functor. Its companion and conjoint are the profunctors

In the case a Monotone Map is “a bunch of arrows, one from each landing at ” — which looks exactly like bridges: that is the companion; mentally reversing every dotted arrow gives bridges from to , the conjoint. This is how profunctors generalize functors.

Sources: 7 Sketches §4.3.3 (Definition 4.34, Examples 4.35, 4.37, Remark 4.39, Exercises 4.36, 4.38, 4.41); [Shu08].

  • The companion and conjoint of both equal the unit profunctor (Example 4.35, 7S Exercise 4.36).
  • is monotone; its companion sends to (Example 4.37) and its conjoint (7S Exercise 4.38). These are the boxes in Co-design diagrams — “not to be designed, but they fit easily into the same framework”.
  • -adjunctions (Remark 4.39): -functors , are adjoint if for all (Eq. 4.40) — generalizing Galois connections from to any . Theorem (7S Exercise 4.41): iff , i.e. ; applied to this gives .
  • In -profunctor language, and are the representable profunctors; iff — the hom-set definition of Adjunction. Companions/conjoints make a proarrow equipment (7 Sketches Preface, §4.6).

Docs: plain Julia — Catlab has no dedicated API for this; related: Catlab v0.16 docs · GATlab standard library

# companion and conjoint of a monotone map F between finite preorders (as Bool matrices)
companion(F, P, Q, leqQ) = Bool[leqQ(F(p), q) for p in P, q in Q]      # F̂(p, q) = [F p ≤ q]
conjoint(F, P, Q, leqQ)  = Bool[leqQ(q, F(p)) for q in Q, p in P]      # F̌(q, p) = [q ≤ F p]
# Galois connection test (Exercise 4.41): F ⊣ G iff companion(F) == transpose(conjoint(G))... i.e. [F p ≤ q] == [p ≤ G q]
companion :: Preorder q => (p -> q) -> Feas p q
companion f = Feas (\p q -> leq (f p) q)
conjoint :: Preorder q => (p -> q) -> Feas q p
conjoint f = Feas (\q p -> leq q (f p))