\begin{section}{Arrow}
The constant function that always returns $a$ is $\const{a}$. The
- identity operator on $V$ is $\identity{V}$. The composition of $f$
- and $g$ is $\compose{f}{g}$. The inverse of $f$ is
- $\inverse{f}$. If $f$ is a function and $A$ is a subset of its
+ identity operator on $V$ is $\identity{V}$ but the argument can be
+ left blank to get a ``generic'' identity, $\identity{}$. The
+ composition of $f$ and $g$ is $\compose{f}{g}$. The inverse of $f$
+ is $\inverse{f}$. If $f$ is a function and $A$ is a subset of its
domain, then the preimage under $f$ of $A$ is $\preimage{f}{A}$.
\end{section}
}
\fi
-% The identity function/arrow on its argument.
-\newcommand*{\identity}[1]{ \operatorname{id}_{{#1}} }
+% The identity function/arrow on its argument. Leave the argument
+% blank to get the plain "id"
+\newcommand*{\identity}[1]{%
+ \operatorname{id}%
+ \if\relax\detokenize{#1}\relax\else%
+ _{#1}%
+ \fi%
+}
\ifdefined\newglossaryentry
\newglossaryentry{identity}{