11

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$?

  • 7
    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. – Mariano Suárez-Álvarez Feb 21 '23 at 23:01
  • 4
    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. $$ – azif00 Feb 21 '23 at 23:18
  • 6
    @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.") – hunter Feb 21 '23 at 23:32
  • 2
    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. – Mariano Suárez-Álvarez Feb 21 '23 at 23:39
  • 2
    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?") – Mariano Suárez-Álvarez Feb 21 '23 at 23:43
  • I think you mean $f \subset \emptyset \times B$, not $A$ - we all knew what you meant but might as well correct it. – user253751 Feb 22 '23 at 21:47
  • This could also be asked about functions with overlapping codomains. Is $f:A \to \mathbb{R}$ the same as $f:A \to \mathbb{Z}$ if the range of $f$ in both cases contains only integers? (disregarding the question of whether the 42 in $\mathbb{R}$ is the same as the 42 in $\mathbb{Z}$) – user253751 Feb 22 '23 at 21:49
  • @MarianoSuárez-Álvarez Plenty of folks work in non-strict categories. "literally no one" is wrong. – Corbin Feb 23 '23 at 02:29

1 Answers1

25

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$.

Greg Martin
  • 78,820
  • 21
    To add a little: Both of these conventions are reasonable and widely-used. The former is probably more common, certainly longer-established, and fit better with the mathematical practice of a century or so. But the latter (including the function’s source and target sets) is in many ways a better fit with mathematical practice today — for just one example, considering “surjectivity” as a property of functions. (Under the former convention, you have to view surjectivity as a relation between a function and a choice of target set.) – Peter LeFanu Lumsdaine Feb 22 '23 at 09:21
  • Really nice answer (along with Peter's comment); wish I could upvote twice. – Matthew Leingang Feb 23 '23 at 01:39