Composing the empty function with itself

functionsproof-explanation

Suppose $X = Y = \emptyset$ and $f: X \to Y$ is a map of sets. Then $f$ is vacuously bijective: for every $a,b \in X$ (there are none), $f(a) = f(b)$ implies $a = b$. Also, for every $y \in Y$ (there are none again), there is $x \in X$ such that $f(x) = y$.

I believe it is a convention that $f$ is its own inverse. I need an inverse of $f: X \to Y$ to take the form $g: Y \to X$, as a general rule, but in this case that is $g: \emptyset \to \emptyset$. The empty function in this list is the empty list. Is there a notion of composing the empty function with itself? In particular, if the claim is that $f$ is its own inverse, can I say
$$
f \circ f = \mathrm{id}_X = \mathrm{id}_Y.
$$

I'm not fully sure what the identity function for the empty set is. Do I need such a notion?

Best Answer

Notice how there really only is one function $\varnothing\to\varnothing$. Thus all your functions, i.e. $f$, $g$, $f\circ f$ and $\operatorname{id}_\varnothing$, are one and the same. The reason behind this is the set-theoretic definition of a function, in which, for a function $f:X\to Y$ we have that

$$f=\{(x,y)\in X\times Y : y=f(x)\},$$

and so, as $\varnothing\times\varnothing=\varnothing$, we have that, for any function $f:\varnothing\to\varnothing$,

$$f=\varnothing,$$

and so there is only one function $\varnothing\to\varnothing$, which just so happens to be the empty set itself.