Defining bijections between sets I am having troubles understanding how to properly define bijections between the sets say $X,Y,Z$ to show that
1) $(Z^X)^Y \cong Z^{(X\times Y)}$
In my notes it says that I can map, $F:X\times Y \rightarrow Z $ to be sent to $y\mapsto f_y$ where $f_y (x)=F(x,y) $ . To be honest I am totally confused with this, could someone please clarify how exactly is this defined and why is it a bijection?
2) There is a similar example for showing $(X\times Y) ^Z \cong X^Z \times Y^Z $ 
For this , I think I kind of understand that we take $f:Z \rightarrow X , g:Z \rightarrow Y $ and construct a function from $Z \rightarrow X \times Y$ by just evaluating $z $ at $(f(z),g(z) )$ but, how do I define it properly so that all the notation makes sense?
 A: For the first question let’s start with the elements of $\left(Z^X\right)^Y$. An element $\varphi$ of $\left(Z^X\right)^Y$ is a function
$$\varphi:Y\to Z^X$$
from $Y$ to $Z^X$: for each $y\in Y$, $\varphi(y)$ is a function from $X$ to $Y$. To avoid ugly notation like $\big(\varphi(y)\big)(x)$, I’ll write $\varphi_y$ for $\varphi(y)$. Thus, for each $y\in Y$, $\varphi_y$ is a function from $X$ to $Z$.
Suppose now that you specify some $\langle x,y\rangle\in X\times Y$. I can apply $\varphi$ to your $y$ to get a function $\varphi_y:X\to Z$, and I can then apply that function to your $x$ to get the element $\varphi_y(x)\in Z$. I can do this for any $\langle x,y\rangle\in X\times Y$, so my $\varphi$ in effect defines a function from $X\times Y$ to $Z$ by
$$X\times Y\to Z:\langle x,y\rangle\mapsto\varphi_y(x)\;.$$
I’ll call this function $F(\varphi)$. To recapitulate, for each $\varphi\in\left(Z^X\right)^Y$ we can define a function $F(\varphi)\in Z^{X\times Y}$ by
$$F(\varphi):X\times Y\to Z:\langle x,y\rangle\mapsto\varphi_y(x)\;.$$
If $\varphi,\psi\in\left(Z^X\right)^Y$, and $\varphi\ne\psi$, there must be some $y\in Y$ such that $\varphi_y\ne\psi_y$, which in turn means that there must be some $x\in X$ such that $\varphi_y(x)\ne\psi_y(x)$. But then
$$F(\varphi)(\langle x,y\rangle)=\varphi_y(x)\ne\psi_y(x)=F(\psi)(\langle x,y\rangle)\;,$$
so $F(\varphi)\ne F(\psi)$. This shows that $F$ is injective.
Intuitively we can think of $F$ as taking a collection of functions $\varphi_y$ from $X$ to $Z$, one for each $y\in Y$, and pasting them together to get a single function from $X\times Y$ to $Z$.

As an example, if $X=Y=Z=\Bbb R$, for each $y\in\Bbb R$ let $f_y:\Bbb R\to\Bbb R$ be the function $f_y(x)=x+2y$. The function $F$ above combines these functions $f_y$ into a single function $f$ from $\Bbb R^2$ to $\Bbb R$ given by $f(\langle x,y\rangle)=f_y(x)=x+2y$.

In fact $F$ is surjective and therefore a bijection. To see this, let $f\in Z^{X\times Y}$ be arbitrary. For each $y\in Y$ we can use $f$ to define a function $f_y$ from $X$ to $Z$ as follows: 
$$f_y:X\to Z:x\mapsto f(\langle x,y\rangle)\;.$$
Each of these functions $f_y$ is an element of $Z^X$, so we’ve actually just defined a function from $Y$ to $Z^X$ that takes $y$ to the function $f_y$. If we call this function $G(f)$, then $G(f)\in\left(Z^X\right)^Y$, and $G$ is therefore a function from $Z^{X\times Y}$ to $\left(Z^X\right)^Y$. As before it makes things more readable if we write $G_f$ instead of $G(f)$: $G$ is the function from $Z^{X\times Y}$ to $\left(Z^X\right)^Y$ that sends $f\in Z^{X\times Y}$ to the function $G_f:Y\to Z^X$, where $G_f(y)=f_y$ is the function from $X$ to $Z$ defined by $f_y(x)=f(\langle x,y\rangle)$.
Intuitively speaking, we’ve sliced up the function $f$ on $X\times Y$ into functions $f_y$ on $X$, one for each $y\in Y$, and $G_f$ is the function that assigns to each $y\in Y$ the correct slice $f_y$. 

In terms of the simple example above, we’re starting with the function $f(\langle x,y\rangle)=x+2y$ from $\Bbb R^2$ to $\Bbb R$ and slicing it up into the functions $f_y(x)=x+2y$ from $\Bbb R$ to $\Bbb R$, one for each $y\in\Bbb R$. For each $y\in\Bbb R$, $G_f(y)=f_y$, the slice of $f$ determined by $y$.

We’re done if we can show that $F(G_f)=f$, thereby showing that $f$ is in the range of $F$; intuitively this amounts to showing that $F$ pastes the functions $G_f(y)=f_y$ together to give us $f$, i.e., that the pasting together done by $F$ exactly undoes the slicing done by $G$.
To show that $F(G_f)=f$, let $\langle x,y\rangle\in X\times Y$ be arbitrary. To simplify the notation, let $\varphi=G_f$, and note that $\varphi_y=\varphi(y)=G_f(y)=f_y$. Then
$$F(G_f)(\langle x,y\rangle)=F(\varphi)(\langle x,y\rangle)=\varphi_y(x)=f_y(x)=f(\langle x,y\rangle)\;,$$
and hence $F(G_f)=f$, as desired.
