Understanding what $\phi(f)(b,c) = f(b)(c)$ means

90 Views Asked by At

Consider $\phi: (A^B)^C \to A^{B \times C}$ given by $\phi(f)(b,c) = f(b)(c)$.

I'm trying to understand the definition of $\phi$ as given above. Suppose $k \in A^B$. Then $k: B \to A.$ Now let $f \in (A^B)^C $. Then $f: C \to \{k\}$ meaning $f(c) = k_i$ for some $i$ and so $f(c)$ is a function and not just a value. Thus the notation $f(c)(b)$ makes sense...but I still can't make sense of what's going on with the definition of $\phi.$ What's the reasoning behind this definition if it's an acceptable question? Thanks.

1

There are 1 best solutions below

5
On BEST ANSWER

Let's write out what everything is. Part of this you already did in the question itself.

  • $A^B$ is the set of functions $B \to A$, so an element $g \in A^B$ is just a function $g: B \to A$ and for each $b \in B$ that means we have some $g(b) \in A$;
  • $(A^B)^C$ is the set of functions $C \to A^B$, so an element $f \in (A^B)^C$ is just a function $f: C \to A^B$ and for each $c \in C$ that means we have some $f(c) \in A^B$, by the above that is again a function $f(c): B \to A$, so for each $b \in B$ we get an element $f(c)(b) \in A$;
  • $A^{B \times C}$ is the set of functions $B \times C \to A$, so an element $h \in A^{B \times C}$ is just a function $h: B \times C \to A$ and for each pair $(b, c) \in B \times C$ that means we have some $h(b, c) \in A$.

The point is that there is a natural bijection between $(A^B)^C$ and $A^{B \times C}$, and this is the map $\phi$ from your post. So $\phi$ is a function $\phi: (A^B)^C \to A^{B \times C}$. Thus given an element $f \in (A^B)^C$ we must produce an element $\phi(f) \in A^{B \times C}$, so $\phi(f)$ must be a function $B \times C \to A$. This function is defined by sending a pair $(b, c) \in B \times C$ to the value $f(c)(b)$ (this is also where there is a typo in your question, you wrote "$f(b)(c)$"). So notationally: $$ \phi(f)(b, c) = f(c)(b). $$

This correspondence is known as Currying. In words we can describe what happens as follows. For a function $f: C \to A^B$ we can turn it into a function $h: B \times C \to A$ by first evaluating $f$ at $C$, and then using that result and evaluating it at $B$. The inverse of this correspondence then goes as follows. If we are given $h: B \times C \to A$, then given some $c \in C$ we can turn it into a function $B \to A$ by fixing that $c$. That is, we get $h(-, c): B \to A$, which sends $b$ to $h(b, c) \in A$.