nLab
free cartesian category

Contents

In this article, we explore cartesian monoidal categories as a doctrine on Cat, by analyzing the structure of free cartesian categories.

It is convenient to discuss the case of categories with arbitrary small products (or arbitrary small coproducts) first, because there we get some very pleasant adjunctions to work with. Then, we may cut down to finite products and derive some possibly unexpected bonuses involving finite limits.

Free product-completions of sets

We start by constructing the free category with small products generated by a set S. This by definition is a category with small products, Prod(S), equipped with a function i:SOb(Prod(S)) with the following universal property: given a category C with small products and a function f:SOb(C), there exists up to (unique) isomorphism a unique product-preserving functor Π:Prod(S)C such that f=Ob(Π)i.

The slice category Set/S is small-cocomplete; therefore (Set/S) op has small products. There is an evident function i:SOb((Set/S) op) which takes sS to s:1S. This can also be regarded as a Yoneda embedding under the equivalence Set/SSet S.

Each object n:NS of (Set/S) op can be regarded as a formal product sSx s n s where S indexes a set of variables x s and n s=n 1(s) is the (cardinality of the) fiber over S. Therefore the following theorem comes as no surprise.

Theorem

(Set/S) op together with i:S(Set/S) op is the free category with small products generated by S.

Proof

Let C be a category with small products. Given f:SOb(C), the functor Π:(Set/S) opC is defined on the object-level: n:NS is sent to sSf(s) n s in C. In addition, a morphism from m:MS to n:NS in (Set/S) op is a function ϕ:NM that satisfies mϕ=n; this in turn consists of a collection of functions ϕ s:n sm s indexed by elements sS, and each such function induces a morphism

f(s) ϕ s:f(s) m sf(s) n sf(s)^{\phi_s}: f(s)^{m_s} \to f(s)^{n_s}

in C, uniquely specified by declaring the i th component of this morphism for in s to be given by

f(s) m sproj ϕ s(i)f(s)f(s)^{m_s} \stackrel{proj_{\phi_s(i)}}{\to} f(s)

Given a morphism ϕ of (Set/S) op, define Π(ϕ) by

Π(ϕ)=f(s) ϕ s sS: sSf(s) m s sSf(s) n s.\Pi(\phi) = \langle f(s)^{\phi_s} \rangle_{s \in S}: \prod_{s \in S} f(s)^{m_s} \to \prod_{s \in S} f(s)^{n_s}.

The functor Π is the unique product-preserving functor (Set/S) opC (up to isomorphism) that extends f:SOb(C).

Given categories with products C and D, let Prod(C,D) denote the category of product-preserving functors F:CD and natural transformations between them. By the preceding theorem, there is an equivalence

Prod((Set/S) op,C)C S\mathbf{Prod}((Set/S)^{op}, C) \simeq C^S

where the right side consists of functors SC (where S is regarded as a discrete category) and natural transformations between them.

Corollary

The category Prod((Set/S) op,Set) is isomorphic to Set/S.

Proof

Because Prod((Set/S) op,Set)Set SSet/S.

Let C be a locally small category with products. There is a Yoneda embedding

y:C opProd(C,Set)y: C^{op} \to \mathbf{Prod}(C, Set)

As we just saw, the Yoneda embedding y:Set/SProd((Set/S) op,Set) is an equivalence. We may arrange that the reverse equivalence Prod((Set/S) op,Set)Set/S is right adjoint to y, and so we denote it as y *.

Theorem

If C is a locally small category with small products and f:SC is a functor, the coproduct-preserving functor Π op:Set/SC op has a right adjoint given by the composite

C opyProd(C,Set)Prod(Π,Set)Prod((Set/S) op,Set)y *Set/SC^{op} \stackrel{y}\to \mathbf{Prod}(C, Set) \stackrel{\mathbf{Prod}(\Pi, Set)}{\to} \mathbf{Prod}((Set/S)^{op}, Set) \stackrel{y^*}{\to} Set/S
Proof

Let g:XS be an object of Set/S and c an object of C. We have the following natural bijections between sets of morphisms:

Π op(g:XS)c inC op cΠ(g:XS) inC y(g:XS)hom C(c,Π) inProd((Set/S) op,Set) (g:XS)y *hom C(c,Π) inSet/S\array{ \Pi^{op}(g: X \to S) \to c & & in C^{op}\\ c \to \Pi(g: X \to S) & & in C\\ y(g: X \to S) \to \hom_C(c, \Pi-) & & in \mathbf{Prod}((Set/S)^{op}, Set)\\ (g: X \to S) \to y^* \hom_C(c, \Pi-) & & in Set/S }

where we get to the third line by the Yoneda lemma. This proves the theorem.

Corollary

Under the hypotheses of the previous theorem, the product-preserving functor Π:(Set/S) opC is a right adjoint. In particular, it preserves all limits, not just products.

Free product-completions of categories

It will be convenient to consider first the coproduct-cocompletion; then the product-completion is obtained by dualizing.

Explicit construction

Let C be a small category. We may construct the free category with coproducts generated by C directly as follows:

  • The objects of Coprod(C) are those of Set/C 0, where C 0 is the set of objects.

  • A morphism (say from f:XC 0 to g:YC 0) is given by a function ϕ:XY together with an X-indexed collection of morphisms of C of the form Φ x:f(x)g(ϕ(x)).

The data of a morphism may be exhibited as a 2-cell of the form

X ϕ Y 1 X Φ g X f C\array{ X & \stackrel{\phi}{\to} & Y \\ \mathllap{1_X} \downarrow & \stackrel{\Phi}{\Rightarrow} & \downarrow \mathrlap{g} \\ X & \underset{f}{\to} & C }

Coproducts of objects in Coprod(C) are computed just as they are in Set/C 0. Each f:XC 0 is then a formal coproduct xf(x), and a morphism (ϕ,Φ): xXf(x) yYg(y) is uniquely determined by its restrictions along the coprojections i x:f(x) xf(x), which in turn are given by composites

f(x)Φ xg(y)i y) yYg(y)f(x) \stackrel{\Phi_x}{\to} g(y) \stackrel{i_y)}{\to} \sum_{y \in Y} g(y)

where y=ϕ(x). The proof of the universal property of Coprod(C) as coproduct cocompletion is then obvious.

As Kleisli construction

Another light on this construction comes from seeing the free coproduct-cocompletion Coprod(C) as sitting inside the free cocompletion Set C op. First, we have a Yoneda mapping

C 0Set C op:chom(,c)C_0 \to Set^{C^{op}}: c \mapsto \hom(-, c)

This induces a coproduct-preserving functor Set/C 0Set C op, which takes an object g:YC 0 to the presheaf

yYhom C(,g(y))\sum_{y \in Y} \hom_C(-, g(y))

By the preceding theorem, this functor has a right adjoint. The right adjoint is simply described: it is the evident underlying functor

Set C opSet/C 0Set^{C^{op}} \to Set/C_0

taking a presheaf F:C opSet to the C 0-indexed set where the fiber over cC 0 is F(c).

Proof

As is well-known, this underlying functor Set C opSet/C 0 is monadic; the monad M C takes an object g:YC 0 to the object whose fiber over c is the set

yYhom C(c,g(y))\sum_{y \in Y} \hom_C(c, g(y))

In other words, the left adjoint to the underlying functor is the coproduct-preserving functor that takes g:YC 0 to

yYhom(,g(y))\sum_{y \in Y} \hom(-, g(y))

as described above.

Notice that M C(g) is given by the top horizontal composite

P C 1 dom C 0 cod Y g C 0 \array{ P & \to & C_1 & \stackrel{\dom}{\to} & C_0 \\ \downarrow & & \downarrow \mathrlap{\cod} & & \\ Y & \underset{g}{\to} & C_0 & & }

where the square is a pullback.

Theorem

The free coproduct-cocompletion of C is the Kleisli category of the monad M C:Set/C 0Set/C 0.

Proof

Let f:XC 0 and g:YC 0 be two objects of Kl(M C). A morphism from f to g in Kl(M C) is a morphism from f to M C(g) in Set/C 0, in other words a map h:XP making the following diagram commute:

X 1 X X h f P C 1 dom C 0 cod Y g C 0 \array{ X & \stackrel{1_X}{\to} & X & & \\ h \downarrow & & & \searrow \mathrlap{f} \\ P & \to & C_1 & \stackrel{\dom}{\to} & C_0 \\ \downarrow & & \downarrow \mathrlap{\cod} & & \\ Y & \underset{g}{\to} & C_0 & & }

Since P is the pullback, the map h is given by maps ϕ:XY, Φ:XC 1 with Φ(x):f(x)g(ϕ(x)) for each xX. But this is how a morphism from f to g was described in the explicit construction of Coprod(C).

Example: Subset

We calculate the free coproduct completion of the interval category 2=(01), and record some properties of this category.

According to theorem 3, this is the Kleisli category of the monad on Set/{0,1} corresponding to the monadic functor Set 2 opSet/{0,1}. This monad takes a pair of sets (X 1,X 0) to (X 1,X 0+X 1); the algebra structure of the free algebra (X 1,X 0+X 1) is the structure of presheaf over 2 given by the inclusion X 1X 0+X 1.

Thus the free coproduct completion of 2 is equivalent to the category Subset who objects are pairs of sets (A,X) where A is a subset of X; morphisms (A,X)(B,Y) are functions f:XY which carry A into B.

This category has many pleasant properties, largely summarized by the fact that it is a Grothendieck quasitopos. Indeed, it can be described as the category of ¬¬-separated presheaves on 2 (so that it is a reflective subcategory of Set 2 op). The reflection takes an object f:XY to the pair (Im(f),Y).

In particular, Subset is complete and cocomplete and cartesian closed. Limits are formed as they are in Set 2 op (that is, objectwise). As are exponentials, since Subset is actually an exponential ideal in Set 2 op. Naturally, coproducts are formed as they are in the presheaf category since Subset is the coproduct completion; coequalizers are constructed by forming them in the presheaf category and then reflecting back into Subset.

Categories enriched in Subset are also called M-categories.

Algebraic theory of a category

The free product-completion of C is obtained by dualization:

Prod(C)=Coprod(C op) op=Kl(M C op) opProd(C) = Coprod(C^{op})^{op} = Kl(M_{C^{op}})^{op}

Here M=M C op is the monad on Set/C 0 whose algebras are functors CSet. This functor category is the category of models of a simple multi-sorted algebraic theory, where the set of sorts is C 0 and each morphism f:cd is regarded as an unary operation. According to the entry algebraic theory, the corresponding Lawvere theory is just Kl(M) op, in other words the product-completion of C. Indeed, the category of models of Kl(M) op is

Prod(Kl(M) op,Set)Prod(Prod(C),Set)Set C\mathbf{Prod}(Kl(M)^{op}, Set) \simeq \mathbf{Prod}(Prod(C), Set) \simeq Set^C

by the universal property of Prod(C).

KZ property

There is no foundational difficulty in forming the free small coproduct-cocompletion of any locally small category C (any more than forming the free cocompletion with respect to small limits). An object of Coprod(C) is a set X together with a function f:XC 0. A morphism from f:XC 0 to g:YC 0 consists of a function ϕ:XY together with an X-indexed collection of morphisms Φ x:f(x)g(ϕ(x)). The hom-sets are clearly small.

To be continued…

Free cartesian category on a signature

There are a number of ways of explaining the same material from a more categorical point of view. Whatever the explanation is, the point is to describe the free category with finite products generated from a multigraph F over S. We denote this free category with products as Term(S,F).

As before, the objects of Term(S,F) are product types: elements of S *. Morphisms from a type T:[m]S to a type T:[n]S are, in the language of the preceding section, n-tuples of normal terms (t 1,,t n) where each t i has arity TT(i). Composition is effected by term substitution. The cartesian product structure is essentially given by concatenating (juxtaposing) lists of sorts and terms.

It is hopefully more or less clear how all of this works in the term syntax approach. Despite this, we believe that the bureaucracy of handling variables in the term syntax is something of a hack; from one point of view (closely related to string diagrams), some of it is actually unnecessary.

For example, the input strings play the role of variables declared in the context, but the difference is that they do not need “variable names” – they only need to be labeled by an appropriate sort, for type-checking purposes. This trick effectively eliminates the need for rules of α-conversion. As we will see, one can also effect a neat division of labor between the business of variable declarations and the business of “pure substitutions”; moreover, this division clarifies the precise entry point of the particular doctrine we are working in (the doctrine of finite product categories).

To begin, recall the following abstract definition:

Definition

Let M be a cartesian monad acting on a finitely complete category C. An M-span in C from c to d is a span of the form

McfxgdM c \stackrel{f}{\leftarrow} x \stackrel{g}{\to} d

M-spans are composed by consideration of a pullback

xy My x Mh Mk Mf g Mb m b MMb Mc d\array{ & & & & & & x \circ y & & & & \\ & & & & & \swarrow & & \searrow & & & \\ & & & & M y & & & & x & & \\ & & & ^\mathllap{M h} \swarrow & & \searrow ^\mathrlap{M k} & & ^\mathllap{M f} \swarrow & & \searrow ^\mathrlap{g} & \\ M b & \stackrel{m_b}{\leftarrow} & M M b & & & & M c & & & & d }

where m:MMM is the multiplication on the monad M. Under this composition, the M-spans are 1-cells of a bicategory M-Span.

In the case where M is the free monoid monad acting on Set, an M-span from a set S to S is the same as a multigraph over S. A monad on S in the bicategory M-Span is a multicategory over S. We are especially interested in the free multicategory generated from a multigraph over S.

The free multicategory construction has other names and descriptions. We could also call it the free nonpermutative S-sorted operad generated by a set of S-typed function symbols. The apex of its underlying span, together with its map to S, can also be referred to as the initial algebra for the polynomial endofunctor P on Set/S which takes an S-indexed set X s to

P(X) s= TS * f:Ts sSX s T sP(X)_s = \sum_{T \in S^\ast} \sum_{f: T \to s} \prod_{s' \in S} X_{s'}^{T_{s'}}

(fF). However it is named, the underlying multigraph of the free multicategory generated by a multigraph F can be described as

Tree(F) in out S * S\array{ & & Tree(F) & & \\ & ^\mathllap{in} \swarrow & & \searrow ^\mathrlap{out} & \\ S^\ast & & & & S }

where Tree(F) is the set of F-labeled planar trees. This means that

  • Nodes of a planar tree are labeled by elements f:Ts of F;

  • Edges of that planar tree are labeled by sorts s, such that the list of labels of incoming edges at a node f:Ts is the word T, and the outgoing edge is labeled s.

The list of labels of “leaves” of an F-labeled tree t (edges that are not outgoing edges of any node) gives an element in(t)S *, and the label of the “root” edge gives an element out(t)S. Notice that F-labeled trees have obvious string diagram representations.

Next, any multicategory generates a (strict monoidal) category. In the present instance, we denote this category as Pro(S,F) (we write “Pro” by analogy with “prop” – whereas props are used for the doctrine of symmetric monoidal categories, pros are used for monoidal categories). The objects of Pro(S,F) are elements of S *. The morphisms of Pro(S,F) could be described as ”F-labeled forests”. Formally, the underlying span of Pro(S,F) is

S *m SS **in *Tree(F) *out *S *S^\ast \stackrel{m_S}{\leftarrow} S^{\ast\ast} \stackrel{in^\ast}{\leftarrow} Tree(F)^\ast \stackrel{out^\ast}{\to} S^\ast

The monoidal product on forests is simply juxtaposition. The composition of forests is the obvious one, plugging in roots of one forest for leaves of another.

The construction Pro(S,F) formalizes what we meant earlier by “pure substitutions of terms”, and lives in the doctrine of (strict) monoidal categories. To switch over to the doctrine of categories with finite cartesian products, we apply a simple trick. Let Pro(S,F)Prod(S) be the composite of the two spans

Prod(S) Pro(S,F) dom cod in out S * S * S *\array{ & & Prod(S) & & & & Pro(S, F) & & \\ & ^\mathllap{dom} \swarrow & & \searrow ^\mathrlap{cod} & & ^\mathllap{in} \swarrow & & \searrow ^\mathrlap{out} & \\ S^\ast & & & & S^\ast & & & & S^\ast }

Then, in the first place, Pro(S,F)Prod(S) carries a canonical category structure. The reason is that, viewing Prod(S) and Pro(S,F) as monads in the bicategory of spans, there is a canonical distributive law

θ:Prod(S)Pro(S,F)Pro(S,F)Prod(S)\theta: Prod(S) \circ Pro(S, F) \to Pro(S, F) \circ Prod(S)

(here Pro(S,F) can be replaced by any pro over S). The idea is that the distributive law θ maps an element of Prod(S)Pro(S,F), which is a pair of arrows

TfTdTT \stackrel{f}{\to} T' \stackrel{d}{\to} T''

with f an arrow of Pro(S,F) and d an arrow of Prod(S), to a pair of arrows in Pro(S,F)Prod(S) whose precise form is dictated by a naturality requirement in d. For example, if d=δ T:TTT, then

θ(f,δ T)=(Tδ TTTffTT)\theta(f, \delta_T') = (T \stackrel{\delta_T}{\to} T \otimes T \stackrel{f \otimes f}{\to} T' \otimes T')

Using this distributive law, the composite of the monads Prod(S) and Pro(S,F) is another monad in the bicategory of spans, and therefore a category with set of objects S *.

The same trick works for other doctrines over the doctrine of monoidal categories. For example, if Perm(S) is the free symmetric (strict) monoidal category generated by S, regarded as a span from S * to S *, then there is a distributive law Perm(S)Pro(S,F)Pro(S,F)Perm(S). Similarly with “symmetric monoidal” replaced with “braided monoidal”.

Definition

Term(S,F)Pro(S,F)Prod(S), regarded as a cartesian category with product structure inherited from Prod(S), meaning that

Prod(S)id S *Prod(S)u1Pro(S,F)Prod(S)Prod(S) \cong id_{S^\ast} \circ Prod(S) \stackrel{u \circ 1}{\to} Pro(S, F) \circ Prod(S)

is a product-preserving functor, where u is the unit of the monad Pro(S,F).

More explicitly, the tensor product on Term(S,F) is a cartesian product provided that there are natural transformations δ:idΔ, ε:ide! which endow each object with a cocommutative comonoid structure. But the naturality follows from the definition of the distributive law, and the cocommutative comonoid axioms already hold in Prod(S).

Note that this abstract description of Term(S,F) is identical to that given by the syntax of normal terms. The “bureaucracy of variables” is here organized into two departments, Prod(S) and Pro(S,F), each having its own individual categorical structure, which interact via the distributive law. (This is the “division of labor” we were talking about, where each arrow of Term(S,F) is factorized into a generalized diagonal map followed by an F-labeled forest.)

Another name for Term(S,F) is “term algebra”, and yet another name for it is “the free S-sorted Lawvere theory generated by a set of S-sorted operation symbols F”.

Theorem

Term(S,F) is the free category with products generated by the multigraph F over S.

Proof

Tree(S,F) is the free multicategory generated by the multigraph F over S, and Pro(S,F) is the free monoidal category generated by the multicategory Tree(S,F). Therefore Pro(S,F) is the free monoidal category generated by the multigraph F. It remains to show that the monoidal inclusion

Pro(S,F)Pro(S,F)id S *1uPro(S,F)Prod(S)Pro(S, F) \cong Pro(S, F) \circ id_{S^\ast} \stackrel{1 \circ u}{\to} Pro(S, F) \circ Prod(S)

is universal among monoidal functors X:Pro(S,F)C to cartesian monoidal categories C.

There is of course a product-preserving functor Prod(S)C compatible with the restriction S *Pro(S,F)XC. At the level of spans, this gives a composable pair of span morphisms

S * dom Prod(S) cod S * in Pro(S,F) out S * C 0 d 0 C 1 d 1 C 0 d 0 C 1 d 1 C 0\array{ S^\ast & \stackrel{\dom}{\leftarrow} & Prod(S) & \stackrel{\cod}{\to} & S^\ast & \stackrel{in}{\leftarrow} & Pro(S, F) & \stackrel{out}{\to} & S^\ast \\ \downarrow & & \downarrow & & \downarrow & & \downarrow & & \downarrow \\ C_0 & \underset{d_0}{\leftarrow} & C_1 & \underset{d_1}{\to} & C_0 & \underset{d_0}{\leftarrow} & C_1 & \underset{d_1}{\to} & C_0 }

which we then compose with the span morphism m:C 1C 1C 1 given by composition in C:

Pro(S,F)Prod(S)C 1C 1mC 1Pro(S, F) \circ Prod(S) \to C_1 \circ C_1 \stackrel{m}{\to} C_1

This gives a morphism between underlying spans, Term(S,F)C. This is functorial (i.e., is a morphism of monads in Span) because both Prod(S)C and Pro(S,F)C are functorial, and also because the compositional equalities enforced by the distributive law θ are preserved: they are taken to equalities expressed by naturality of diagonal maps and projection maps in C. The functor Term(S,F)C is product-preserving, because Prod(S)C is product-preserving. The uniqueness of the product-preserving extension Term(S,F)C is clear since the subcategories Prod(S) and Pro(S,F) together generate Term(S,F).

Revised on March 11, 2013 14:47:25 by Toby Bartels (98.19.40.58)