# Question on the "empty function"

Let's say that I have a function $$f: A \to B$$. I'd define a function, rigorously, as a set $$\{(x, f(x)) \mid \forall x \in A, \; \exists ! b \in B \; s.t. b = f(x)\}.$$ If $$A = \emptyset$$, then $$f \subset \emptyset \times A$$, but $$\emptyset \times A = \emptyset$$, so that implies that $$f = \emptyset$$. That is, $$f$$ is the "empty function."

My question is: if I change $$B$$, is this the same "empty function"? I could have $$B_1 = \emptyset$$, $$B_2 = \mathbb{R}$$, $$B_3 = \{1,2,3\}$$, and so forth, and define $$f_1: A \to B_1$$, $$f_2: A \to B_2$$, and $$f_3: A \to B_3$$. Each of these produce the empty set and the empty function, but are they technically different functions since I defined the codomain differently? Is this a case where I would say for all $$x \in A$$, $$f_1 (x) = f_2 (x) = f_3 (x),$$ i.e., the rules align, vacuously, but $$f_1 \neq f_2 \neq f_3$$?

• A function is determined by the choice of a domain, of a codomain and a "law". If you change the codomain you change the function. Commented Feb 21, 2023 at 23:01
• Defining $f \colon A \to B$ to be $\{(x, f(x)) \mid \forall x \in A\, \exists ! y \in B: y = f(x)\}$ makes no sense, $f \colon A \to B$ is a relation $f \subseteq A \times B$ with the property $$\forall x \in A\, \exists ! y \in B: (x,y) \in f.$$ Commented Feb 21, 2023 at 23:18
• @MarianoSuárez-Álvarez This is how I think mathematicians should formalize functions, but in practice in ZFC they are defined as their graphs. In this case, precisely in the case where the domain is empty, the codomain is irrelevant, since $\emptyset \times B = \emptyset$ for any choice of $B$. (Equals, not just "is canonically isomorphic to.") Commented Feb 21, 2023 at 23:32
• And ordered triples are often defined as iterated pairs, and literally no one thinks of them that way. If one defines functions as their graphs, then the answer changes, but that's simply because one chose a definition we do not really use. For example, with that definiton the word surjective simply means nothing: the phrase " the function is surjective" stops making sense. Commented Feb 21, 2023 at 23:39
• If the question was "if I define functions to be their graphs, are all the functions with empty domain the same?" the answer would have been, or course, yes. (That is not the question, mostly because it is clearly the question "are all empty sets the same?") Commented Feb 21, 2023 at 23:43

The answer depends on whether your formalism defines a relation from $$A$$ to $$B$$ as
• a subset $$S$$ of $$A\times B$$, or
• an ordered triple $$(A,B,S)$$ where $$S$$ is a subset of $$A\times B$$.
(A function is a relation with an additional property, but that turns out to be irrelevant to this answer.) In the second case, changing the codomain obviously results in a different function. However, in the first case, there is legitimate ambiguity: the codomain can be changed any supserset of $$B$$, and indeed to any superset of the set-of-second-coordinates of $$S$$, without changing the function. This last statement implies, as a special case, that if $$A=\emptyset$$ then the function is the same function regardless of the choice of $$B$$.