categories
from “the method of coalgebra”, a book by j. rutten
[def 1] a category consists of
- objects
- for each pair of objects , a collection of morphisms (“arrows”) ( is the domain, is the codomain)
- an operation called composition of morphisms: for any two morphisms , , there is a morphism
graph LR
A -- $$f$$ --> B
B -- $$g$$ --> C
A -- $$g\circ f$$ --> C
- an identity morphism for each object such that
- axioms: and
For example, a pre-ordered set () is a category where:
- objects are elements
- morphisms are given by the relation:
- compositionality results from the transitivity of : given () and (), we also have ()
- identity results from the equality
- the associativity of compositionality also results from the properties of
With this example we notice that lattices are also categories!
Given that we only talk about objects and arrows, it’s important to be explicit about the types of objects (and arrows’ domain/codomain).
[def 2] a function is injective if
[def 3] a function is surjective if
[def 4] a function is monic if
graph LR
Z -- $$f\circ g$$ --> Y
Z -- $$g$$ --> X
X -- $$f$$ --> Y
Z -- $$h$$ --> X
Z -- $$f\circ h$$ --> Y
[def 5] a function is epic if
graph LR
X -- $$g\circ f$$ --> Z
Y -- $$g$$ --> Z
X -- $$f$$ --> Y
Y -- $$h$$ --> Z
X -- $$h\circ f$$ --> Z
is injective iff monic and surjective iff epic.
We care about how an object behaves and interacts with other objects, rather than how it’s constructed.
[def 6] a product of and is an object with two arrows called projections:
graph
P($$A\times B$$)
P -- $$\pi_1$$ --> B
P -- $$\pi_2$$ --> C
such that for all objects and arrows and , there exists a unique arrow: satisfying:
graph
P($$A\times B$$)
Q($$\forall C$$)
Q -- $$f$$ --> A
P -- $$\pi_1$$ --> A
Q -- $$\exists! \lang f, g\rang$$ --> P
Q -- $$g$$ --> B
P -- $$\pi_2$$ --> B
i.e., and , with unique . Products are unique up to isomorphism!
[def 7] a functor assigns:
- to each oject an object
- to each arrow an arrow such that preserves composition and identities
An object is initial for every object there exists a unique arrow . An object is final if for any object there exists a unique arrow .
When reverting the arrows in a category we obtain a new property called dual. For example, reversing the monic diagram:
graph LR
A-- $$g$$ --> B
B -- $$f$$ --> C
A -- $$h$$ --> B
we obtain:
graph RL
B -- $$g$$ --> A
C -- $$f$$ --> B
B -- $$h$$ --> A
yields the epic diagram.