# Why is an empty function considered a function?

A function by definition is a set of ordered pairs, and also according the Kuratowski, an ordered pair $(x,y)$ is defined to be $$\{\{x\}, \{x,y\}\}.$$ Given $A\neq \varnothing$, and $\varnothing\colon \varnothing \rightarrow A$. I know $\varnothing \subseteq \varnothing \times A$, but still an empty set is not an ordered pair. How do you explain that an empty function is a function?

• Well the definition of a function is a triple of sets $(A, B, C)$ where $C \subseteq A \times B$, and the elements in $C$ must satisfy certain condition (you know which condition I assume), here $A$ is the domain and $B$ the codomain of the function. The empty function makes perfect sense with this definition because even though as you say, the empty set is not an ordered pair, that does not matter because still $\emptyset \subseteq \emptyset \times B$. Yes, its "graph" is empty, it does not have ordered pairs, but there's no contradiction in the definition. Jun 15 '11 at 22:58
• Maybe you should also read the Wikipedia entry for empty function, where the last paragraph gives an example of where it appears in category theory. Jun 15 '11 at 23:07
• @Qiaochu, mathematical practice is more varied and flexible than your emphatic comment suggests. (See mathoverflow.net/questions/30381/definition-of-function/…) Despite the occasional dogmatic insistance on the Bourbaki definition, almost no mathematical argument relies in any essential way on this co-domain-required concept of function, since one can simply specify a codomain whenever it is desired. Meanwhile, large parts of mathematics, including nearly 100% of the literature in logic and set theory, use principally the function-as-graph concept.
– JDH
Jun 16 '11 at 12:20
• @JDH: fair enough. I don't like to think of myself as a dogmatic person, but there are certain perspectives that make things make sense to me and I generally explain things in terms of those perspectives. Of course there are other perspectives. Jun 16 '11 at 12:40
• @Qiaochu, Oh, I wasn't at all suggesting that you were dogmatic, but rather just that this is a topic on which dogmatic views are sometimes expressed. To my way of thinking, however, there is very little at stake mathematically in the difference between the two definitions.
– JDH
Jun 16 '11 at 15:46

One thing to point out is that a function is not just any set of ordered pairs; a binary relation is a set of ordered pairs. However, a function $F$ in this case is a special type of binary relation such that for every $x\in\text{dom }F$, there is a unique $y\in\text{ran }F$, such that $xFy$, or $(x,y)\in F$. But $\text{dom }\varnothing=\varnothing=\text{ran }\varnothing$. Can you find some $x\in\text{dom }\varnothing$ such there is not a unique $y\in\text{ran }\varnothing$ for which $x\varnothing y$? Since you cannot, $\varnothing$ is indeed a function.

I believe that the answer lies hidden within the depth of "vacuously true argument".

An argument of the form $\forall x\varphi$ is true if and only if there is no $x$ such that $\lnot\varphi(x)$.

For example if our universe is the natural numbers with the usual $\ge$ order, then $\forall x(x\ge 0)$ is true because there are no negative numbers.

On the other hand, $\forall x(x\ge 0 \land x\neq 0)$ is false, simply because setting $x=0$ is a counterexample.

More generally, a sentence "If $p$ then $q$" ($p\implies q$, or $p\rightarrow q$) is true whenever the assumption is false, i.e. $p$ never occurs.

An example I often use is "If I am standing upside down from the ceiling right now, then you are all unicorns". It does not matter that I am talking to people, and not to unicorns, because I never stand upside down from the ceiling (it gives me a huge headache, you see).

The next point in our journey towards the empty function, is the bounded quantification. When we write $\forall x\in A(P(x))$ we actually write $\forall x(x\in A\rightarrow P(x))$, this means that we quantify over all the possible $x$, but if $x\notin A$ then we do not care about it anymore (the proposition is true since the assumption is false).

And lastly, the definition of a function $F$ is this: \begin{align} \forall z & (z\in F\rightarrow\exists x\exists y(z=\{\{x\},\{x,y\}\})\land\\ & \forall x(\exists z\exists y(z\in F\land z=\{\{x\},\{x,y\}\})\rightarrow \\ &\qquad(\forall u\forall v(\exists z\exists w((z\in F\land w\in F\land z= \{\{x\},\{x,v\}\}\land w=\{\{x\},\{x,u\}\})\rightarrow u=v) \end{align}

Let's read this long formula. It says that $F$ is such that every element of $F$ is an ordered pair, and for every $x$, if there is an ordered pair $z$ with $x$ for left coordinate, then there is only one such pair (i.e. given two pairs, if their right coordinate is equal then they are equal).

Informally, $F$ is a function if it is a set of ordered pairs, that for every $x\in Dom(f)$ there is a unique $y$ such that $\langle x,y\rangle\in F$.

An example is $F=\{\langle 1,2\rangle\}$ is a function, all its members are ordered pairs, and since there is only one member it automatically satisfies the requirement that the left-coordinate determines the pair.

On the other hand $R=\{\langle 1,2\rangle,\langle 1,3\rangle\}$ is a set that indeed all its members are ordered pairs, but there are two distinct ordered pairs with $1$ in the left coordinate, so it is not a function.

And even more $A=\{3,\langle 1,2\rangle\}$ is clearly not a function, since $3$ is not an ordered pair!

The definition of a function is vacuously true when it is applied to the empty set, let us see why:

1. For all $z$ if $z\in\emptyset$ then $z$ is an ordered pair is vacuously true, as no $z$ is a member of the empty set.
2. Next we have, that for all $x$, if there is some ordered pair in the empty set, with $x$ as left coordinate then the right coordinate is unique, this is also vacuously true since there is no ordered pair in the empty set with $x$ in the left coordinate. This is exactly the case $p\rightarrow q$ and $p$ is false.

The conjunction of two true statement is true as well, therefore the empty set satisfies the requirement that every element of it is an ordered pair, and if two ordered pairs have the same left coordinate then they are equal. Therefore, $\emptyset$ is a function.

The empty set is a set of ordered pairs. It contains no ordered pairs but that's fine, in the same way that $$\varnothing$$ is a set of real numbers though $$\varnothing$$ does not contain a single real number.

• It might be worth pointing out that $\varnothing \times A = \varnothing$, so the empty function is the unique function $\varnothing \to A$.
– t.b.
Jun 15 '11 at 22:55
• ...so, the initial element in Set (--see en.wikipedia.org/wiki/Initial_and_terminal_objects) Jun 15 '11 at 23:52
• Shouldn't it be "Though $\varnothing$ contains no real number"? Jun 17 '11 at 11:29
• Do you mean that "Every element of $\varnothing$ is a real number" by saying "$\varnothing$ is a set of real numbers"? Aug 21 at 10:16
• @Tedebbur It’s the same. Aug 21 at 11:23