# Practical Foundations of Mathematics

## 7.1  Examples of Universal Constructions

Because of the importance of universal properties, we devote this section to collecting examples of them. As usual, the purpose of this is to give the flavour of the many ways in which this concept can behave, rather than to advance or rely on any particular mathematical specialisation. The most directly useful formulation of universal properties is one of the oldest; it is also the one which can most readily be generalised, idiomatically expressing factorisation systems, function-spaces and many other notions. Compare, for example, the next diagram and that in Definition  7.1.7 with the one for orthogonality in Definition  5.7.1.

DEFINITION 7.1.1 We say that h:XÛ UA is a universal map from the object X ö obS to the functor  U:AÛ S if, whenever f:XÛ UQ is another morphism with Q ö obA, there is a unique A-map p:AÛ Q such that h;U p = f ( cf Remark 3.6.3 for posets).

omitted diagram environment

If every object X has a universal map to U then the latter is called an adjunctible functor.

As we showed for the terminal object in Theorem 4.5.6, the universal property determines A up to unique isomorphism. So it is a description, but in the interchangeable sense which we discussed at the end of Section 1.2. Of course this is why we generalised Russell's theory. Although any description allows us to introduce a function (indeed a funct or, the left adjoint) there is a loss of logical clarity here because of the choices; we prefer to shift the balance of the formulation back from algebra to logic.

EXAMPLES 7.1.2 Adjoint monotone functions.

(a)
Let U:A ä S = P(S) be the inclusion of the lattice of closed subsets for a system of closure conditions on a set S. Then h:XÛ UA is the inclusion of an arbitrary subset X ä S in its closure (Section  3.7).

(b)
The possibility modal operator < > , existential quantifier $and direct image \funf! in Section 3.8. These will be developed in Section 9.3. (c) In general, let U:AÛ S be a monotone function with F\dashv U. Then h:XÛ U(FX) is one of the inequalities in Lemma 3.6.2. Colimits Examples 3.6.10 gave meets as adjoint monotone functions. EXAMPLES 7.1.3 (a) Let U:AÛ 1 be the unique functor to the category with one object (*) and only its identity morphism. Then h = \id* :*Û U0 is the universal map iff 0 ö obA is the initial object. The mediating homomorphism p:0Û Q is the unique map, cf Example 3.6.10(a), Definition 4.5.1ff and Definition 5.4.1(a). (b) Let U:AÛ AxA be the diagonal functor AÛ A,A, and N and Y two objects of A. Then the pair h = n0,n1:N,YÛ A,A is universal iff it is a coproduct diagram. Given maps f:NÛ Q and g:YÛ Q, the mediator is p = [f,g], cf Example 3.6.10(b), Definitions 4.5.7ff and 5.4.1(b) . omitted diagram environment (c) Let U:AÛ A\rightrightarrows be the diagonal functor to the category whose objects are parallel pairs; h = (q,r) is universal iff r = u;q = |;q and q is the coequaliser (Definition 5.1.1(a) and Proposition 5.6.8ff). (d) Let ê be any diagram-shape and U:AÛ Aê the diagonal or constant functor ( XÛ l i.X) into the functor category Aê (Theorem 4.8.10). Then for \typeX(-):ê Û A and A ö obA, h: \typeX(-)Û UA is universal iff it is a colimiting cocone. For any cocone f, the mediator p in Definition 7.1.1 is that from the colimit, cf Example 3.6.10(c). We shall treat general limits and colimits fully in Section 7.3. Free algebras Besides coequalisers, the new feature which arises when we move from posets to categories is the free algebra (Chapter VI). EXAMPLES 7.1.4 (a) Let U:AÛ S be the forgetful functor CRngÛ Set. Then A is Z[X], the ring of polynomials in a set X of indeterminates, and p evaluates polynomials using the assignment f:XÛ Q. (b) With A = Vsp, let A ä RX consist of those functions a:XÛ R with non-zero values at only finitely many elements of X. The unit h(x) is the xth basis vector and p(Íi\argaixi) = Íi\argaif(xi). (c) Let U:RngÛ Mon, forgetting addition. The free ring A consists of linear combinations of elements of a monoid. When X = G is a group this is called the group ring Z G. Similarly, with K any ring, for the coslice U:K RngÛ Mon (the objects of K Rng are called K- algebras), we get the group ring KG. (d) Let A = Rel, Pos, Sp, Graph or Cat and S = Set, with U the forgetful functor. Then A is X with the discrete structure (the empty relation, equality, all subsets open, no arrows, and only identity maps). Section 7.4 discusses techniques for constructing free algebras. Completions An important special case of universal maps arises from completing'' an object, so that when it is complete (re-)applying the construction has no (further) effect. This is most the direct analogue of a closure operation (Section 3.7, but see also Section 7.5). LEMMA 7.1.5 Following Definition 4.4.8, any functor U:AÛ S is (a) full and faithful iff id:UAÛ UA is a universal map from UA to U for each A ö obA, and (b) an equivalence functor iff for every X ö obS there is an invertible universal map h:X ¤ UA. A (full, and often by convention replete) inclusion A ä S which is adjunctible is called a reflective subcategory (Corollary 7.2.10(b)). PROOF: (a) [[a]] Both conditions say that "f:UAÛ UQ .$!p:AÛ Q.f = id;U p.

(b)
[[b]] For equivalence we also need, for each X ö ob S, some isomorphism h:X ¤ UA. The issue is therefore to show that any such h is a universal map. For any f:XÛ UQ there is a unique p:AÛ Q with Up = h-1;f :UAÛ UQ, since U is full and faithful. []

EXAMPLES 7.1.6 Reflections are sometimes completions (the universal map is injective) and sometimes quotients (where it is surjective).

(a)
Pos ä Preord is reflective, the quotient h:X\twoheadrightarrow X/ ~ described in Proposition 3.1.10 being the universal map.

(b)
Let S be the category of metric spaces and isometries (functions that preserve distance) and A ä S the full subcategory of spaces in which every Cauchy sequence (Definition  2.1.2) converges. This is reflective, and the universal map h:X\hookrightarrow A is an inclusion.

(c)
The functor U:Set\hookrightarrow Graph which treats a set as a discrete graph (Example  7.1.4(d)) is the inclusion of a reflective subcategory, where h:X\twoheadrightarrow X/ ~ is given by the set of (zig-zag) components (Lemma 1.2.4 ). Similarly we have the components of a preorder, groupoid or category.

(d)
Imposing laws such as distributivity or commutativity on algebras, for example the reflections of DLat\hookrightarrow Lat, CMon\hookrightarrow Mon and AbGp\hookrightarrow Gp, results in a quotient.

(e)
The reflection of AbGp in CMon adjoins negatives, but unless the monoid has the cancellation property "x, y, z.x+z = y+zß x = y (as with NÛ Z ) there is also identification.

(f)
Let S be the category of integral domains and monomorphisms and Fld ä S be the full subcategory of fields. Then h:X\hookrightarrow A is the inclusion of X in its field of fractions, for example Z\hookrightarrow Q .

(g)
Let S be the category of well founded relations and simulations, so S ¤ Coalg(P) by Remark 6.3.5. Let A be the full subcategory which consists of the extensional relations; set-theorists call its objects transitive sets, and its maps are set-theoretic inclusions [Osi74]. Then A ä S is reflective; Andrzej Mostowski (1955) used Definition  6.7.5 to find the extensional quotient set- theoretically. See Exercise 9.62 and [ Tay96a] regarding the axiom of replacement.

Co-universal properties

DEFINITION 7.1.7 A map e:FXÛ A is said to be co-universal from the functor F:SÛ A to the object A if for every map p:FGÛ A in A there is a unique map f:GÛ X in S such that Ff;e = p.

omitted diagram environment

EXAMPLES 7.1.8

(a)
Coclosures, universal quantifiers ("), necessity ([]) and other right adjoint monotone functions, analogously to Examples 7.1.2.

(b)
Limits, X = lim\typeAi, the duals of Examples  7.1.3. The co-unit e is the family of projections (pi).

(c)
((-)ìf)\dashv (fß ( = )) in a Heyting semilattice (Proposition 3.6.14).

(d)
Let S be a cartesian closed category and F = (Yx(-)): SÛ S. Then e:F XÛ A is universal iff X = AY and e is evaluation.

(e)
For the forgetful functor F:SetÛ Rel, X = P(A) and e(a) = {a}.

(f)
For F:SetÛ Pfn, X = Lift A and e(a) = lifta (Definition  3.3.7).

(g)
The co-reflection of Gp into Mon gives the group of units.

(h)
Set, again with the discrete structure, is co-reflective in Bin, Sp, Graph , Preord, Gpd and Cat. Co-universality of e:F XÛ A says that X is A with the indiscriminate structure (also called indiscrete or chaotic), which cannot distinguish between points. So xÛ y, x È y, X(x,y) = {*} , etc for all xy. Classically, the indiscriminate topology only has ó and X as open sets.

(i)
For any set (alphabet'') G, the set G of G- streams carries a map read:GÛ GxG, so it is a coalgebra for the functor (-)xG (Lemma  6.1.8). Let F be the underlying set functor. Then FXÛ 1 is co-universal from F to 1 ( ie X is the terminal coalgebra) iff X = GN ¤ GNxG, this structure being induced by N+1 ¤ N.

There are also examples of symmetrically adjoint contravariant functors, generalising Galois connections (Proposition  3.8.14). Recall in particular that negation, (-)ß ^, is symmetrically self-adjoint (Exercise 3.50).

EXAMPLES 7.1.9

(a)
The Lineland Army is a monoid equipped with a symmetric self-adjunction (Example 1.2.7 and Exercise  7.8).

(b)
Let S be any object of a cartesian closed category S, such as W in Set. Then XÛ SX, as a functor SÛ Sop, is symmetrically adjoint to itself on the right. omitted diagram environment

(c)
Let S be a field, say R. For a vector space V, the dual space V* consists of the linear maps VÛ S . Then (-)*:SÛ Sop defines a self- adjoint functor on the category of vector spaces, whose unit was the original natural transformation (Example 4.8.8(b)).

EXAMPLES 7.1.10

(a)
The inclusion BA ä HSL of Boolean algebras in the category of Heyting semilattices has both a reflection and a co-reflection, and these functors are the same. Exercise 7.12 shows that this situation always arises from a natural idempotent, in this case \lnot \lnot .

(b)
The inclusion Gp ä Mon is also both reflective and co-reflective, but now the two adjoints are different, as they are for the inclusion of any complete sublattice (Remark  3.8.9).

Classifying categories   We have constructed the preorder or category of contexts and substitutions Cn[]L for various fragments [] of logic.

REMARK 7.1.11 There is an analogy between Z[[(x)\vec]] and Cn[]L:

(a)
Extensionally, each of them is the system of well formed formulae built up from some indeterminates ([(x)\vec] or L) using certain operations, namely addition and multiplication, or the logical connectives of the fragment []. (Recall also that the hom-set Cn×L([[(x)\vec]:[(X)\vec]],Y) is the free algebra on generators [(x)\vec], modulo the laws.)

(b)
Any sequence [(a)\vec] ö R of elements of another ring, or any model M of L in a semantic world E, may be substituted for the indeterminates, and the syntactic formulae  evaluated'' using structural recursion. omitted diagram environment

(c)
Intensionally, this is a universal property, because Z[[(x)\vec]] and Cn[]L have the same structure as R or E and [[-]] is the unique homomorphism of this structure taking the generic object to the concrete one.

EXAMPLES 7.1.12 This analogy is precise for propositional logic.

(a)
Let [] be unary propositional logic. Then LÛ \CloneL is inclusion of (a set with) a binary relation (unary closure condition, Section 3.8) in its reflexive-transitive closure. This is the universal map from L to the forgetful functor U:PreordÛ Bin; in fact Preord is reflective in Bin (an object of which is a set with a binary endorelation).

(b)
Let [] be Horn logic (propositional algebraic); then U is the forgetful functor from SLat. For propositional geometric and intuitionistic logic, the category A is Frm or HSL (Section 3.9).

(c)
Let [] be classical propositional logic, so A = BA (Boolean algebras), and let X be a finite set. Then Cn booleX = 22X is the set of disjunctive or conjunctive normal forms (Remark 1.8.4) in the set X of atomic propositions, together with their negations.

(d)
U:CSLatÛ Pos. Then A = shv(X) = [XopÛ W], the lattice of lower sets, ordered by inclusion (Definition 3.1.7), with h(x) = X x and p(I) = ÖQ {f(x)|x ö I} by Proposition 3.2.7(b).

It also works at the level of types for unary algebraic theories.

(e)
The classifying monoid for a free single-sorted unary theory gives the universal map to U ¤ List:Mon Û Set. In Section 2.7 we wrote [[l]] = fold(e,m,f,l).

(f)
A many-sorted free unary theory is described by an oriented graph; the classifying category is composed of paths ( U:Cat Û Graph).

(g)
Finally, elementary sketches present equational many-sorted unary theories, and the classifying category is free on the sketch.

REMARK 7.1.13 The intuition that Cn[]L has a polynomial structure is a valuable one, but there are three technical problems.

(a)
For an adjunction'' Cn[](-)\dashv L[] we need a category of languages, but there seems to be no convincing notion of map L1Û L2, even for elementary sketches. In Sections I §10and II §14of [LS86], Joachim Lambek and Philip Scott define language morphisms to match their semantic interpretation, Cn[]L1Û Cn[]L2. However, this is not consistent with our use of Bin and Graph above, and so loses the dynamic aspect of the language which was the theme of Sections 3.7-3.9 and also of Chapter VI. See also Remark  7.5.2.

(b)
The semantic structure corresponding to the type theory (products, exponentials, etc ) is itself characterised categorically by universal properties. In defining the classifying category, should we require [[-]] to preserve them on the nose (and to be unique up to equality), as we expect from syntax, or only up to isomorphism, as is the case for semantics? This question itself is the subject of Section  7.6. If we take the semantic option, then the universal property of the classifying category is more complicated than Definition  7.1.1: the interpretation functor [[-]] is only unique up to unique isomorphism - if it is defined at all, as some Choice is to be made.

(c)
The axiom-scheme of replacement is needed to construct [[-]].

The second question also arises when we define limits and colimits of categories; we shall return to this point at the end of the next section.

REMARK 7.1.15 Historically, these intuitions emerged from algebraic geometry in the form of a classifying topos. The fragment of logic which is classified by toposes (known as geometric logic) includes products, equalisers and arbitrary pullback-stable colimits, the coproducts being disjoint and the quotients effective (Chapter V). In particular it allows existential quantification and infinitary disjunction.

By analogy with polynomials, the classifying topos for, say, groups was written Set[G]. Given a group G in another topos E, [[-]]:Set[G]Û E evaluates type-expressions by substituting the particular group G for the generic G. Being a homomorphism of the categorical structure, [[-]] preserves finite limits and has a right adjoint, written \nearrow * ¤ [[-]]\dashv \p*. Such an adjoint pair is called a geometric morphism, and is the analogue for toposes of the inverse and direct image operations on open sets that arise from a continuous function \nearrow between spaces. Then groups in E correspond to continuous functions \nearrow :EÛ Set[G]; in particular the points'' of the topos Set[G] are ordinary groups, since the topos Set denotes a singleton space. Hence Set[G] is thought of as the space of groups,'' not to be confused with the category Gp - homomorphisms are in fact the specialisation order'' (Example  3.1.2(i)) on this space.

This analogy between model theory and topology explains why both subjects depend so heavily on Choice: it is necessary to find points, models or prime ideals with certain properties. However, propositional geometric logic is only special in so far as its model theory has this familiar points-and- open-sets form, whereas the categorical model theory of full first order logic has not yet been fully worked out. Classifying gadgets may be constructed in a uniform way for any fragment of logic, although we have considered simpler ones; besides, we have been interested in toposes as models of higher order logic, the relevant homomorphisms being logical functors, ie those that preserve W.