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 operator/arrow on its argument.
27 \newcommand*
{\identity}[1]{ \operatorname{id
}_
{{#1}} }
29 % The composition of two arrows/functions. For example, the
30 % composition of g with f is \compose{g}{f}\of{x} === g\of{f\of{x}}.
31 \newcommand*
{\compose}[2]{ {#1}\circ{#2} }
33 % The inverse of an arrow, function, or whatever.
34 \newcommand*
{\inverse}[1]{ #1^
{-
1} }
36 % The preimage of the second argument (a set) under the first (a function).
37 \newcommand*
{\preimage}[2]{ #1^
{-
1}\of{#2} }