Proposition

Let RR be a ring and let A1A_1 and A2A_2 be sets. Then

(RA1)A2R(A1×A2).(R^{\oplus A_1})^{\oplus A_2} \cong R^{\oplus (A_1 \times A_2)}.

Proof

Note that the elements of (RA1)A2(R^{\oplus A_1})^{\oplus A_2} are finite support functions from A2A_2 to the space of finite support functions RA1R^{\oplus A_1}, which contains functions from A1A_1 to R.R.

Let ff be any element of R(A1×A2)R^{\oplus (A_1 \times A_2)} and consider the map f:A2RA1f' : A_2 \to R^{\oplus A_1} given by a2g,a_2 \mapsto g, where g:A1Rg : A_1 \to R is given by a1f(a1,a2).a_1 \mapsto f (a_1, a_2). We’ll use cc to denote this procedure mapping ff to ff'.

Let hh be any element of (RA1)A2(R^{\oplus A_1})^{\oplus A_2} and consider the map h:A1×A2Rh' : A_1 \times A_2 \to R given by (a1,a2)h(a2)(a1).(a_1, a_2) \mapsto h(a_2)(a_1). We’ll use uu to denote this procedure mapping hh to h.h'.

We can verify that uu and cc are two-sided inverses of each other by

u(c(f))(a1,a2)=c(f)(a2)(a1)=f(a1,a2),u(c(f))(a_1,a_2) = c(f)(a_2)(a_1) = f(a_1,a_2),

and

c(u(h))(a1)(a2)=u(h)(a1,a2)=h(a2)(a1).c(u(h))(a_1)(a_2) = u(h)(a_1,a_2) = h(a_2)(a_1).

Note also that they preserve finite support property, since they bijectively reindex a finite support function.

We’ll check that uu is an RR-module homomorphism. For any h(RA1)A2h \in (R^{\oplus A_1})^{\oplus A_2} and rRr \in R note that

u(rh)(a1,a2)=(rh)(a2)(a1)=rh(a2)(a1)u(rh)(a_1,a_2) = (rh)(a_2)(a_1) = r \cdot h(a_2)(a_1)

and also, for any h,k(RA1)A2h, k \in (R^{\oplus A_1})^{\oplus A_2} we have

u(h+k)(a1,a2)=(h+k)(a2)(a1)=(h(a2)+k(a2))(a1)=h(a2)(a1)+k(a2)(a1).\begin{align*}u(h+k)(a_1,a_2) &= (h+k)(a_2)(a_1) \\ &= (h(a_2)+k(a_2))(a_1) \\ &= h(a_2)(a_1)+k(a_2)(a_1).\end{align*}

Since uu is an RR-module homomorphism with an inverse, it’s an isomorphism.

\blacksquare

NOTE

This is simply the curry/uncurry isomorphism.

curry :: ((a1, a2) -> r) -> (a2 -> (a1 -> r))
curry f a2 a1 = f (a1, a2)
 
uncurry :: (a2 -> (a1 -> r)) -> ((a1, a2) -> r)
uncurry f (a1, a2) = f a2 a1