Just as the graph of a function , or more generally that of a relation for is nothing but the category of elements of the corresponding characteristic function , so the graph of a functor , or more generally that of a profunctor , is nothing but its category of elements.
For let and be a realization of the notions of -category of -categories and of the -category of -categories, respectively, such that standard constructions of category theory work, in particular a version of the Yoneda lemma. See higher category theory.
Then with let be a (-)functor.
By the general logic of distributors this defines an -correspondence
The graph of is the fibration classified by .
Mike Shulman: It’s not obvious to me that this is the best thing to call the graph of a functor; there are lots of other graphy things one can construct from a functor that all reduce to the usual notion of the graph of a function. To start with, there is of course also the induced opfibration oven , would you call that the “opgraph”? But actually, the two-sided fibration (an opfibration over and a fibration over ) looks to me more like a graph. And then there is of course the other profunctor induced by , which gives a fibration over , an opfibration over , and a two-sided fibration from to .
Urs Schreiber: I would be inclined to loosely say “graph” for all of these and to introduce terminology like “opgraph” when it really matters which specific realization we mean. Because all these seem to be so similar to me that I am not sure if it is worth distinguishing them a lot. For instance, wouldn’t an analogous discussion be possible concerning what we call given a functor ? I don’t actually know what a standard term is, does one say “opfunctor” for this? But I’d say it doesn’t matter much either way, calling just a functor which effectively is the functor doesn’t do much harm.
Colin Zwanziger: Aren’t we better off defining graph of a function as a span to avoid an arbitrary choice of or and then treating the two-sided fibration as the graph of a functor?Edit: Actually, we would still have to choose whether we were taking the graph of the representable or corepresentable profunctor induced by the functor, since these yield different spans. But we have that two functors F and G are adjoint iff (Lawvere's definition) the (graph of F)_A and (graph of G)_B agree. One level down we would have two functions f and g are adjoint (=inverse) iff (graph of f)_A and (graph of g)_B agree, but the two notions of graph turn out to be the same at this level.
To reproduce the ordinary notion of graph of a function let . then -categories are just sets and a functor is just a function between sets. Moreover, the category of -categories is the set of truth values, as described at (-1)-category. The profunctor corresponding to is therefore the characteristic function
(Notice that in this case .)
which identifies with the subset of pairs for which . This is the ordinary notion of graph of a function.