definition example

Let be a -Profunctor. Its collage (DaoFP: cograph) is the -category with and

with collage inclusions , . Its Hasse diagram is the union of the two Hasse diagrams plus the bridges as arrows — “put a box around the whole picture and see a new preorder”.

Sources: 7 Sketches §4.3.3 (Definition 4.42, Example 4.43, Exercise 4.44), Example 4.11; DaoFP §17.1 (“Collages”), Exercises 17.1.1–17.1.2.

Example 4.43 (): , (weights ), bridge . Collage matrix (rows/cols ): : ; : ; : ; : (7 Sketches prints the empty hom-object as , which in is ).

DaoFP: the new morphisms across the collage are heteromorphisms, going only from to ; composition with them is by lifting along the profunctor. A profunctor “should really be called an endo-profunctor” — it defines a collage of with itself. There is a functor from any collage to the Walking Arrow (DaoFP Exercise 17.1.1), and conversely any category with a functor to the walking arrow splits as a collage (DaoFP Exercise 17.1.2): profunctors are the same as categories over with fibres and .

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

Builds on: Cost (CostPre), Enriched Category (VCategory), Profunctor (VProfunctor) — run those notes’ Julia code first.

# collage of a V-profunctor between finite V-categories: block matrix [X Φ; 0 Y]
function collage(P::VProfunctor)
  V = P.X.base; zero = join(V, [])                    # ⋁∅
  hom = [P.X.hom P.Φ; fill(zero, size(P.Φ, 2), size(P.Φ, 1)) P.Y.hom]
  VCategory(V, vcat(P.X.objects, P.Y.objects), hom)
end
# Example 4.43
X = VCategory(CostPre(), [:A, :B], [0.0 2; Inf 0]); Y = VCategory(CostPre(), [:x, :y], [0.0 3; 4 0])
Φ = VProfunctor(X, Y, [5.0 8; Inf Inf])
is_vcategory(collage(Φ))     # true
-- the collage of two categories along a profunctor: objects are a sum, heteromorphisms are p a b
data ColObj x y = InX x | InY y
data ColHom p x y a b where
  HomX :: (a -> b) -> ColHom p x y (InX a) (InX b)   -- schematic: homs within X
  Het  :: p a b -> ColHom p x y (InX a) (InY b)      -- heteromorphisms from X to Y (never back)