• No results found

1.4 Category theory

2.1.5 Anafunctors

As an intuition for anafunctors it is helpful to keep in mind the equivalent concept of functorsC→clqD—both represent functors whose values are specified only up to unique isomorphsim. Such functors represent a many-to-many relationship between objects of C and objects of D. Normal functors, as with any function, may of course map multiple objects of Cto the same object in D. The novel aspect is the ability to have a single object ofCcorrespond to multiple objects ofD. The key idea is to add a class of “specifications” which mediate the relationship between objects in the source and target categories, in exactly the same way that a “junction table” must be added to support a many-to-many relationship in a database schema. This is illustrated in Figure 2.2. On the left is a many-to-many relation between a set of shapes and a set of numbers. On the right, this relation has been mediated by a “junction table” containing a set of “specifications”—in this case, each specification is simply a pair of a shape and a number—together with two mappings (one-to-many relations) from the specifications to both of the original sets, such that a specification maps to a shapes and number n if and only if s and n were originally related.

Definition 2.1.4 (Makkai [1996]). Ananafunctor F :CDis defined as follows.

• There is a class S of specifications.

3In fact, clq turns out to be a (2-)monad, and the category of clique functors is its Kleisli

4 3 2 1 4 3 2 1 2 1 4 3 2 1

Figure 2.2: Representing a many-to-many relationship via a junction table

• There are two functions ObC S

←− F

o

o −→F //

ObD mapping specifications to ob- jects ofC and D.

S,←F−, and −→F together define a many-to-many relationship between objects ofC and objects ofD. D∈Dis called aspecified value of F at C if there is some specification

s ∈ S such that ←F−(s) = C and →−F(s) = D, in which case we write Fs(C) = D.

Moreover, D is a value of F at C (not necessarily a specified one) if there is some s

for which D∼=Fs(C).

The idea now is to impose additional conditions which ensure that F acts like a regular functorCD.

• Functors are defined on all objects; so we require each object of C to have at least one specificationswhich corresponds to it—that is,←F−must be surjective.

• Functors transport morphisms as well as objects. For eachs, t ∈S (the middle of the below diagram) and each f : ←F−(s) → ←F−(t) in C (the left-hand side below), there must be a morphismFs,t(f) :

− →

F(s)→−→F(t) in D(the right-hand side):

• Functors preserve identities: for eachs∈Swe should haveFs,s(id←F(s)) = id−→F(s). • Finally, functors preserve composition: for alls, t, u ∈S (in the middle below),

f : ←F−(s) → ←F−(t), and g : ←F−(t) → ←F−(u) (the left side below), it must be the case that Fs,u(f;g) = Fs,t(f) ;Ft,u(g):

Remark. Our initial intuition was that an anafunctor should map objects of C to equivalence classes of objects in D. This may not be immediately apparent from the definition, but is in fact the case. In particular, the identity morphism idC maps to

isomorphisms between specified values ofC; that is, under the action of an anafunctor, an object C together with its identity morphism “blow up” into a clique. To see this, lets, t ∈Sbe two different specifications corresponding toC, that is,←F−(s) =←F−(t) =

C. Then by preservation of composition and identities, we have

Fs,t(idC) ;Ft,s(idC) =Fs,s(idC;idC) = Fs,s(idC) =id−→F(s),

so Fs,t(idC) and Ft,s(idC) constitute an isomorphism betweenFs(C) and Ft(C).

Remark. It is not hard to show that cliques in D are precisely anafunctors from 1to

D. In fact, more is true: the class of functors C → clqD is naturally isomorphic to

the class of anafunctors CD (for the proof, see Makkai [1996, pp. 31–34]).

There is an alternative, equivalent definition of anafunctors, which is somewhat less intuitive but usually more convenient to work with.

Definition 2.1.5. An anafunctor F : CD is a category S together with a span

of functors C S ←− F o o −→F // D where ←−

F is fully faithful and (strictly) surjective on objects.

Remark. In this definition, ←F− must be strictly (as opposed to essentially) surjective

on objects, that is, for every C ∈ C there is some S ∈ S such that ←F−(S) = C, rather than only requiring ←F−(S) ∼= C. Given this strict surjectivity on objects, it is equivalent to require ←F− to be full, as in the definition above, or to be (strictly) surjective on the class of all morphisms.

We are punning on notation a bit here: in the original definition of anafunctor,

S is a set and ←F− and −→F are functions on objects, whereas in this more abstract definition S is a category and ←F− and −→F are functors. Of course, the two are closely related: given a span of functors C S

←− F

o

o −→F //

D, we may simply take the objects

objects as the functions from specifications to objects of C and D. Conversely, given a class of specifications S and functions ←F− and −→F, we may construct the categoryS with ObS =S and with morphisms ←F−(s) →←F−(t) in C acting as morphisms s → t

in S. From S to C, we construct the functor given by←F− on objects and the identity on morphisms, and the other functor maps f :s → t in S to Fs,t(f) :

− →

F(s)→ −→F(t) inD.

Every functor F :CD can be trivially turned into an anafunctor

Coo Id C F //D.

Anafunctors also compose. Given compatible anafunctors F : C S

←− F o o −→F // D and G: D T ←− G o o −→G //

E, consider the action of their composite on objects: each object of Cmay map to multiple objects ofE, via objects ofD. Each such mapping corresponds

to a zig-zag path t   E s   D C

In order to specify such a path it suffices to give the pair (s, t), which determines

C, D, and E. Note, however, that not every pair in S ×T corresponds to a valid path, but only those which agree on the middle object D ∈ D. Thus, we may take

{(s, t)|s∈S, t∈T,−→F(s) =←G−(t)}as the set of specifications for the compositeF;G, with ←−−−F ;G(s, t) =←F−(s) and −−−→F ;G(s, t) =−→G(t). On morphisms, (F ;G)(s,t),(u,v)(f) =

Gt,v(Fs,u(f)). One can check that this satisfies the anafunctor laws.

The same thing can also be defined at a higher level in terms of spans:

S×DT ←− F0   − → G0 T ←− G   − → G E S ←− F   − → F D C

Catis complete, and in particular has pullbacks, so we may construct a new anafunc- tor fromCtoEby taking a pullback of−→F and←G−and then composing appropriately, as illustrated in the diagram.

One can go on to define ananatural transformations between anafunctors, and show that together these constitute a 2-category AnaCat which is analogous to the usual 2-category of (small) categories, functors, and natural transformations; in particular, there is a fully faithful embedding of Cat intoAnaCat, which moreover

is an equivalence if AC holds. See Makkai [1996] for details.

To work in category theory based on set theory and classical logic, while avoid- ing AC, one is therefore justified in “mixing and matching” functors and anafunc- tors as convenient, but discussing them all as if they were regular functors (except when defining a particular anafunctor). Such usage can be formalized by turning ev- erything into an anafunctor, and translating functor operations and properties into corresponding operations and properties of anafunctors. However, this is tediously complex (imagine if an introductory category theory textbook followed up the defini- tion of categories with the definition of anafunctors!) and, as we will see, ultimately unnecessary. By founding category theory on HoTT instead of set theory, we can avoid the axiom of choice without incurring such complexity overhead. In a sense, HoTT takes all the added complexity of anafunctors and moves it into the background the- ory, so that “normal” functors secrectly become anafunctors.