Functions $f:\varnothing\to\varnothing$, how many are there? How many functions from an empty set to itself can we define?
I have found that there is exactly one function from an empty set to any non-empty set. But now I just want to know is this also true if both sets are empty or not?
 A: Looking at the definition of a function as a set of ordered pairs fulfilling certain properties, we see that the empty set is a function from the empty set to the empty set, just as it is a function from the empty set to any other set.

Definition of a function: A set $f$ is a function from the set $X$ to the set $Y$ if it consists of ordered pairs $(x, y)$ where $x\in X$ and $y\in Y$ such that each $x\in X$ appears in exactly one such pair.
A: In set theory a function $f:A\to B$ is usually a set of pairs with some additional properties. So you write $f(a)=b$ instead of $(a,b)\in f$ where $a$ is from the domain $A$ and $b$ from the codomain $B$. If domain and codomain are empty then $f$ can contain no pairs, hence $f=\varnothing$. Strange but I guess this counts as a function. And it is the unique one.
A: A function $f: A \to B$ is actually three pieces of data: the domain $A$, the codomain $B$, and the rule $f$ which assigns to each element of $A$ an element of $B$, which is a certain subset $R \subseteq A \times B$. Hence a function is a triple $(A, B, R)$.
If the domain and codomain are $\emptyset$, then the relation $R$ is necessarily also $\emptyset$. So $(\emptyset, \emptyset, \emptyset)$ is a function. The key point is that a function is not "just" the rule, it also remembers where it's coming from and where it's going to.
A: Some hints: Using the definition of set equality, show that all empty sets are identical, thus there is only one empty set $\emptyset$. Then use the definition of a Cartesian product to prove the existence of the set $f=\emptyset\times\emptyset$. Then use the definition of a function to prove that $f:\emptyset \to \emptyset$. Finally, suppose we have another function $g:\emptyset \to \emptyset$ and prove that $\forall x\in \emptyset: g(x)=f(x)$, thus there is only one function mapping $\emptyset$ to itself.
A: One way to think about this is that the number of functions from a set $A$ to a set $B$ is $|B|^{|A|}$, because there are $|A|$ choices to make, each of which has $|B|$ options. In fact, the notation for this set of functions is $B^A$. In your examples, $A$ is empty so we're raising to the power of $0$, giving $1$ function.
A: A function $f:X\rightarrow Y$ is a relation $f\subseteq X\times Y$ which is left-total (i.e., for each $x\in X$ there is some $y\in Y$ such that $(x,y)\in f$) and right-unique (i.e., if $(x,y_1)\in f$ and $(x,y_2)\in f$, then $y_1=y_2$).
''At least one and at most one'' means ''exactly one''. Thus a relation $f$ is a function if and only if for each $x\in X$ there is exactly one $y\in Y$ with $(x,y)\in f$, written $f(x)=y$. This is a basic definition of function, which should help you to understand the case of empty set.
We have $X\times Y=\emptyset$ iff $X=\emptyset$ or $Y=\emptyset$. The empty relation is a function (which is a consequence of the above definitions (which are implications with empty premises).
