$X^\emptyset$ versus $\emptyset^X$ I recently read that there is a difference between $X^\emptyset$ and $\emptyset^X$. I was hoping that someone could explain why this is the case.
I have interpreted $B^A$ as, "The set of all functions that have a domain of $A$ and a range of some subset of $B$". More formally, I thought that:
$f \in B^A \leftrightarrow \exists Z ( Z \in P(B)\  \land f \subseteq A \times Z) $ <-- Edit: $\color{red}{ \text{Here is the mistake} }$
Additionally, we know that $\emptyset \times X = X \times \emptyset=\emptyset \times \emptyset = \emptyset$
It is vacuously true that $\forall x [\emptyset \subseteq x]$
Also, $P(\emptyset)=\{\emptyset\}$, which means that $\emptyset \in P(\emptyset)$ and, more generally, $\forall x [\emptyset \in P(x)]$
Using this information, consider the following two cases:
Case 1: $X^\emptyset$
Case 2: $\emptyset^X$

Case 1: $X^\emptyset$
Consider if $f$ is the empty set function.
Does a $Z$ satisfy the following formula? $Z \in P(X)\  \land \emptyset \subseteq \emptyset \times Z$
Sure! Let $Z=\emptyset$.
$\emptyset$ is an element of $P(X)$ and $\emptyset$ is a subset of $\emptyset \times \emptyset = \emptyset$.
Therefore, $X^\emptyset = \{ \emptyset \}$

Case 2: $\emptyset^X$
Consider if $f$ is the empty set function.
Does a $Z$ satisfy the following formula? $Z \in P(\emptyset)\  \land \emptyset \subseteq X\times Z$
Yup. If $Z=\emptyset$, then $\emptyset \in P(\emptyset)$ and $\emptyset \subseteq X \times \emptyset=\emptyset$
Therefore, $\emptyset^X=\{\emptyset\}$

So where exactly did I go wrong?
 A: The empty set function isn´t a function from $X$ to $\varnothing$, because its domain is $\varnothing$, not $X$. So the problem is in case 2.
Moreover, your formula $f \in B^A \leftrightarrow \exists Z ( Z \in P(B)\  \land f \subseteq A \times Z)$ is not right, because any subset $f$ of $A\times B$ satisfies $\exists Z ( Z \in P(B)\  \land f \subseteq A \times Z)$ (putting $Z=B$).
A correct formula would be:
$f\in B^A \leftrightarrow (f\subseteq A\times B)\land(\forall a\exists b \;\langle a,b\rangle\in f)\land (\forall a\forall b\forall c\neg(b\neq c\land\langle a,b\rangle\in f\land \langle a,c\rangle\in f))$.
Where the first parenthesis says the domain and codomain are $A$ and $B$ respectively, the second one says that every element of $A$ has an image and the third one says no element of $A$ can have two different images.
A: Assume $X\neq\emptyset$.
Case 1. By definition $X^\emptyset = \{ f:\emptyset \to X\}$. At least one such map exists, we'll show it's unique. Suppose $f,g\in X^\emptyset$. Then $f,g$ coincide on the $\emptyset$ (vacuously), hence they must be equal.
Case 2. $\emptyset ^X = \{f:X\to\emptyset\}$. Suppose $\emptyset^X \neq\emptyset$. Then there exists $f:X\to \emptyset$. In particular $f(x) \in \emptyset$ for any $x\in X$. Therefore, $\emptyset ^X = \emptyset$.
