To have a category, the elements and morphisms have to satisfy some constraints:
<pre>
- (i) the class of morphisms has to be closed under composition: where f:C1→C2 and g:C2→C3, g o f is also a morphism of the category, which maps C1→C3.
+ (i) the class of morphisms has to be closed under composition: where f:C1→C2 and g:C2→C3, g º f is also a morphism of the category, which maps C1→C3.
(ii) composition of morphisms has to be associative
(iii) every element E of the category has to have an identity morphism 1<sub>E</sub>, which is such that for every morphism f:C1→C2: 1<sub>C2</sub> o f = f = f o 1<sub>C1</sub>
</pre>
* any monoid `(S,*,z)` generates a category with a single element `x`; this `x` need not have any relation to `S`. The members of `S` play the role of *morphisms* of this category, rather than its elements. All of these morphisms are understood to map `x` to itself. The result of composing the morphism consisting of `s1` with the morphism `s2` is the morphism `s3`, where `s3=s1*s2`. The identity morphism for the (single) category element `x` is the monoid's identity `z`.
-* a **preorder** is a structure `(S, <=)` consisting of a reflexive, transitive, binary relation on a set `S`. It need not be connected (that is, there may be members `x`,`y` of `S` such that neither `x<=y` nor `y<=x`). It need not be anti-symmetric (that is, there may be members `s1`,`s2` of `S` such that `s1<=s2` and `s2<=s1` but `s1` and `s2` are not identical). Some examples:
+* a **preorder** is a structure `(S, ≤)` consisting of a reflexive, transitive, binary relation on a set `S`. It need not be connected (that is, there may be members `x`,`y` of `S` such that neither `x≤y` nor `y≤x`). It need not be anti-symmetric (that is, there may be members `s1`,`s2` of `S` such that `s1≤s2` and `s2≤s1` but `s1` and `s2` are not identical). Some examples:
* sentences ordered by logical implication ("p and p" implies and is implied by "p", but these sentences are not identical; so this illustrates a pre-order without anti-symmetry)
* sets ordered by size (this illustrates it too)
- Any pre-order `(S,<=)` generates a category whose elements are the members of `S` and which has only a single morphism between any two elements `s1` and `s2`, iff `s1<=s2`.
+ Any pre-order <code>(S,≤)</code> generates a category whose elements are the members of `S` and which has only a single morphism between any two elements `s1` and `s2`, iff <code>s1≤s2</code>.
Functors