TITLE: “Natural” bijection in category theory?
QUESTION [7 upvotes]: There is a bijection between $\mathcal P(X)$ and $2^X$ where $2=\{0,1\}$, namely $U\subseteq X\mapsto f$ where $f(x)=1$ iff $x\in U$. This bijection is “natural” in an informal sense.
On the other hand, there may be a bijection between $\mathcal P(X)$ and some other arbitrary set $Z$, that happens to have the same cardinality. I would call this bijection informally “unnatural”.
Does my informal idea of “natural” in this context correspond to an idea of naturality in category theory?

REPLY [4 votes]: Here's a possible interpretation: take the contravariant functor
$$
\newcommand{\c}[1]{\mathbf{#1}}
\newcommand{\cop}[1]{\c{#1}^{op}}
\newcommand{\parts}[1]{\mathcal{P}(#1)}
\newcommand{\2}[1]{2^{#1}}
\begin{align}
\parts{-} : &\ \c{Set} \longrightarrow \cop{Set} \\
& X \longmapsto \parts{X} \\
& \downarrow^f \ \mapsto \ \uparrow^{\parts{f}} \\
& Y \longmapsto \parts{Y}
\end{align}
$$
with $\parts{f}(A) = f^{-1}(A)$. Using your notation, there is another contravariant functor in $\c{Set}$ that can be defined as $\2{-} := \hom_{\c{Set}}(-,\{0,1\})$. To formalize your intuition, one would like to have a natural transformation between these.
In fact, we actually have a natural isomorphism defined by:
$$
(\eta_X : \parts{X} \to 2^X)_{X \in \c{Set}}, \quad  \eta_X(A)(x) = \cases{1 \text{ if } x \in A \\ 0 \text{ otherwise}}
$$
which is to say that $\eta_X(A) = \chi_A \in \hom(X,\{0,1\}) = \2{X}$. In effect, $\eta$ is natural because given an arrow $f :X \to Y$ in $\c{Set}$,
$$
\eta_X\parts{f}(A) = \eta_X(f^{-1}(A)) = \chi_{f^{-1}(A)} = \chi_Af = f^*(\chi_A) = \2{f}(\eta_X(A))
$$ 
with $2^f = f^*$ being the precomposition of $f$, i.e. $f^*(g) := gf$. Finally, $\eta$ is an isomorphism as each arrow $\eta_X$ is

injective because if $A \neq A' \in \parts{X}$ then $\eta_X(A)(z) \neq \eta_X(A')(z)$ for $z \in A' \triangle A$.
surjective because given $s : X \to 2$, then $s = \chi_{s^{-1}(1)} = \eta_X(s^{-1}(\{1\}))$.

and isomorphisms in $\c{Set}^{op}$ are bijections.