2 % Things dealing with arrows in a category. Or functions, basically.
4 \ifx\havemjoarrow\undefined
8 \input{mjo-common
} % for \of, at least.
10 \ifx\operatorname\undefined
15 % The constant function that always returns its argument.
16 \newcommand*
{\const}[1]{\operatorname{const
}_
{{#1}}}
18 \ifdefined\newglossaryentry
19 \newglossaryentry{const
}{
20 name=
{\ensuremath{\const{a
}}},
21 description=
{the constant function that always returns $a$
},
26 % The identity function/arrow on its argument.
27 \newcommand*
{\identity}[1]{ \operatorname{id
}_
{{#1}} }
29 \ifdefined\newglossaryentry
30 \newglossaryentry{identity
}{
31 name=
{\ensuremath{\identity{X
}}},
32 description=
{the identity function or arrow on $X$
},
37 % The composition of two arrows/functions. For example, the
38 % composition of g with f is \compose{g}{f}\of{x} === g\of{f\of{x}}.
39 \newcommand*
{\compose}[2]{ {#1}\circ{#2} }
41 % The inverse of an arrow, function, or whatever.
42 \newcommand*
{\inverse}[1]{ #1^
{-
1} }
44 % The preimage of the second argument (a set) under the first (a function).
45 \newcommand*
{\preimage}[2]{ #1^
{-
1}\of{#2} }