Defining a tricky function: $(A \rightarrow \mathcal{P}(B)) \rightarrow\mathcal{P}(A \rightarrow B)$ How would I define a function of the form:
\begin{align*}
\phi: (A \rightarrow \mathcal{P}(B)) \rightarrow\mathcal{P}(A \rightarrow B)
\end{align*}
I know what behaviour I want, I'm just struggling to define it. For example,
consider a function 
\begin{align*}
&f: {0, 1} \rightarrow \mathcal{P}(\{0, 1, 2, 3\}) \\
&f(0) = \{0, 1\} \\
&f(1) = \{2, 3\} \\
\end{align*}
I want $\phi(f)$ to be:
\begin{align*}
&\phi(f) = \{g_1, g_2, g_3, g_4 \} \\
&g_1(0) = 0 \qquad g_1(1) = 2 \\
&g_2(0) = 0 \qquad g_2(1) = 3 \\
&g_3(0) = 1 \qquad g_3(1) = 2 \\
&g_4(0) = 1 \qquad g_4(2) = 3 \\
\end{align*}
That is, I want all possible combinations of $\{0, 1\} \times \{2, 3\}$ as functions.

The elements of $\phi(f)$ are exactly those $g \colon A \to B$ for which
$$\forall a \in A: g(a) \in f(a).$$
They are choice functions: for every $a \in A$, they choose an element $g(a) \in f(a)$. The fact such a function, in general, exists at all is the axiom of choice.
