2

A directed graph (diagram scheme, quiver) is a quadruple $(O, A, s, t)$, where $O$ is a set of objects, $A$ is a set of arrows and $s$ and $t$ are two mappings $s, t: A \to O$ ("source" and "target" of arrows respectively).

Then a category is defined as a directed graph with two additional mappings $id: O \to A$ (called identity) and $\circ : A \times_{O} A \to A$ (called composition), following usual rules of associativity, composition with identity etc.

The confusion with that definition for me is that it looks like any other definition in style of "a set with some extra stuff". I mean, for example, I can take any set and define group operations on it. But I can't take any directed graph and define a category structure on it. E.g. let $D = (\{1,2,3\}, \{a,b\}, s, t)$, where $s(a) = 1$, $s(b) = 2$ and $t(a) = 2$ and $t(b) = 3$ (i.e. there's no possible choices for identities and compositions). Identities and compositions restrict the choices of directed graphs.

What's wrong with such reasoning? And what is correct way of thinking about such definition of category?

NB. That's not a question about how to construct a free category on a given directed graph, it's about construction of a category according given definition.


UPDATE. Thanks to the answers, now I see where's the error in my reasoning. But confusion is still there. Citing Categories for the Working Mathematician:

Every category $C$ determines a graph $UC$ with the same objects and arrows, forgetting which arrows are composites and which are identities. Every functor $F: C \to C'$ is also a morphism $UF: UC \to UC'$ between the corresponding graphs. These observations define the forgetful functor $U : \mathbf{Cat} \to \mathbf{Grph}$ from small categories to small graphs.

How this underlying graph of category relates with the one mentioned in definition of a category? They can't be the same just because underlying graph doesn't contain identities and compositions.

user144765
  • 691
  • 1
  • 5
  • 17
  • 2
    The definition has nothing to do with "constructing" anything. It's just tells you what counts as a category. – Malice Vidrine Dec 11 '20 at 20:14
  • 2
    The question in your update seems to be predicated on the idea that $U$ is surjective. It is not. Why do you expect otherwise? – Eric Towers Dec 12 '20 at 08:27
  • I don't understand your update - what exactly is problematic? Not every graph is the underlying graph of a category, but so what? Again, it might help to consider a perhaps-more-familiar example: think of the functor sending a ring to its underlying abelian group (the "addition-only" part of the ring). – Noah Schweber Dec 12 '20 at 21:16
  • Thanks, I think I got it: I erroneously thought that the functor is full. – user144765 Dec 12 '20 at 22:32

2 Answers2

8

It may help to consider the similar-sounding definition of a ring as an abelian group $(A,+)$ equipped with an additional operation $*$ satisfying [properties]. As with the "digraph-to-category" situation, not every abelian group can be expanded to a ring; see e.g. here. On the other hand, there may be more than one way to expand an abelian group into a ring (this is a good exercise).

And this happens already at the level of sets: the fact that

"I can take any set and define group operations on it"

is not something to be taken for granted. For example, it's false for fields, since any finite field has cardinality a prime power; there is no field whose underlying set has $6$ elements, for example. Boolean algebras provide another case, since every finite Boolean algebra has size a power of $2$. The fact that for every $n$ there is a group of cardinality $n$ is something which requires proof. Now that proof is quite easy, so this may be overlooked, but it is definitely a nontrivial feature.


EDIT: I don't understand your update - what exactly is problematic? Not every graph is the underlying graph of a category, but so what?

Again, it might help to consider a perhaps-more-familiar example: think of the functor sending a ring to its underlying abelian group (the "addition-only" part of the ring). Like the $U$ of the question, this functor is neither injective on objects (reflecting the fact that there may be more than one way to expand a given abelian group into a ring) nor surjective on objects (reflecting the fact that there may be no way to expand a given abelian group into a ring). But none of this is an issue.

Noah Schweber
  • 219,021
  • 18
  • 276
  • 502
7

If instead of groups you said e.g. Boolean algebras, then your argument would fail for one-sorted structures as well: every finite Boolean algebra has cardinality $2^n$, so not every set carries a Boolean algebra structure.

Similarly, not every graph is an underlying graph of a category: as you observed, one of the necessary conditions is that there's at least one loop $x\to x$ on each vertex.

Berci
  • 87,772
  • 3
  • 52
  • 97