I've been reading Awodey's Category Theory and I've seen the definition of the Identity function in it. As it's definition was always a function $f:A\to A$ I used to assume that the identity function would be $f(x)=x$ and this made me question the utility of such a concept. But now I've been taking lectures on elements of mathematics, and we had a thorough list of exercises which envolved the definition of functions, the main definition of function in these lists is:
- $\forall x\in A, \forall y,y'\in B:(xRy\wedge xRy')\implies y=y'$
- $\forall x\in A,\exists y\in B:xRy$
Considering this, I'm starting to guess that the identity function could be anything that obeys these rules and not only $f(x)=x$, after all, $f(x)=2x+1$ is also a function $f:\mathbb{R}\to \mathbb{R}$. Is that correct?
The identity morphism in an abstract category is a somewhat "opaque" object (and may not even be conceptually a function). However, if we take the categoiry of sets (and functions) as a standard example of a category, then the identity morphism really is the identity map, i.e. the one given by $f(x)=x$. After all, we need (among others) $\operatorname{Id}_A\circ \operatorname{Id}_A=\operatorname{Id}_A$ to hold (follows from the axioms of category theory); this alone rules out $f(x)=2x+1$ as a candidate identity for $\mathbb R$ (as e.g. $f(f(0))=3\ne f(0)$). More generally, let $A$ be a set and assume that $\operatorname{Id}_A$ is not the obvious identity function. If we let $f$ be the actual identity function, i.e. $f(x)=x$ for all $x\in A$, we know from the axioms of category theory that $f\circ \operatorname{Id}_A= f$. For $x\in A$, the righ thand side maps $x\mapsto x$, whereas the left hand side maps $x\mapsto \operatorname{Id}_A(x)$. We conclude that $\operatorname{Id}_A(x)=x$ for all $x\in A$.