It looks like you're new here. If you want to get involved, click one of these buttons!
A tiny category.
Recall that a category consists of the data:
a set \(Ob(C) \) of objects;
for every pair of objects \(c,d \in Ob(C) \) a set \(C(c,d) \) of morphisms;
for every three objects \(b,c,d \) and morphisms \(f : b \to c \) and \(g : c \to d \), a specified morphism \((f ; g) : b \to d \) called the composite of \(f \) and \(g \);
for every object \(c \), an identity morphism \(id_c \in C(c,c) \); and
subject to two laws:
Unit: for any \(f : c \to d \), the equations \(id_c ; f = f \) and \(f ; id_d = f \) hold.
Associative: for any \(f_1 : c_1 \to c_2, f_2 : c_2 \to c_3 \), and \(f_3 : c_3 \to c_4 \), the equation \((f_1 ; f_2) ; f_3 = f_1 ; (f_2 ; f_3) \) holds.
--
This tiny category is sometimes called the walking arrow category \(2 \).
(a) Write down the set of objects, the four sets of morphisms, the composition rule, and the identity morphisms.
(b) Prove that this category obeys the unit and associative laws.
Comments
For funzies, here is the definition and proof via Idris. I use the definition of Category from idris-ct:
https://gitlab.com/snippets/1930056
For funzies, here is the definition and proof via [Idris](https://www.idris-lang.org/). I use the definition of Category from [idris-ct](https://github.com/statebox/idris-ct): [https://gitlab.com/snippets/1930056](https://gitlab.com/snippets/1930056)
I don't understand what it means by the four sets of morphisms.
I don't understand what it means by **the four sets of morphisms**.
@kenwebb Here is a hint: look at 2. in the definition of category above. For every pair of objects, we must have a set of morphisms (the set may be empty). There must be four pairs of objects in our category. Which pairs do you see?
@kenwebb Here is a hint: look at **2.** in the definition of category above. For every **pair** of objects, we must have a set of morphisms (the set may be empty). There must be four pairs of objects in our category. Which pairs do you see?
Thanks @JakeGillberg. The key observation that I was missing is that any of the four sets of morphisms might be the empty set. There's no actual arrow corresponding to the pair (2,1).
Thanks @JakeGillberg. The key observation that I was missing is that any of the four sets of morphisms might be the empty set. There's no actual arrow corresponding to the pair (2,1).
@JakeGillberg Is it possible to write a similar proof in Haskell? I tried it here (https://paste.sr.ht/~leif/86497a18e9ae2ba10daaed64302284a287c21ad6) but got stuck on what to put for the definition of identity.
@JakeGillberg Is it possible to write a similar proof in Haskell? I tried it here (https://paste.sr.ht/%7Eleif/86497a18e9ae2ba10daaed64302284a287c21ad6) but got stuck on what to put for the definition of identity.