1-1 Correspondence $(S \times T) \times U$ and $S \times (T \times U)$ (Herstein section 1.2 problem 3) 
If $S, T, U$ are nonempty sets, prove that there exists a one-to-one correspondence $(S \times T) \times U$ and $S \times (T \times U)$.
An element of $(S \times T) \times U$ is of the form $((s,t),u)$ and for $S \times (T \times U)$ an element is of the form $(s,(t,u))$. 
I am unsure of such a function. The only thing that comes to mind is that given an element of the form $((s,t),u)$ take the $T$ value from $S \times T$ and then take the $U$ value from $(S \times T) \times U$ to obtain an element of $T \times U$ and then take that value and cross it with the value from $S$ to get an element from $S \times (T \times U)$. 
But I am highly unsure of this function as it is literally looking at the form of the elements and essentially "swapping the parentheses".
 A: You are exactly correct, the formula for the bijection is "swapping parentheses":
$$f((s,t),u) = (s,(t,u))
$$
What needs verification is that this satisfies the definition of a function: for all $s_1,s_2 \in S$, $t_1,t_2 \in T$, $u_1,u_2 \in U$, if $((s_1,t_1),u_1) = (s_2,t_2),u_2)$ then $(s_1,(t_1,u_1))=(s_2,(t_2,u_2))$.
The proof of this applies the following: 

Law of ordered pairs: For all $a_1,a_2,b_1,b_2$, 
  $$(a_1=a_2 \quad\text{and}\quad b_1=b_2) \quad\text{if and only if}\quad (a_1,b_1)=(a_2,b_2)
$$

To apply this, start with the assumption that
$$(\underbrace{(s_1,t_1)}_{a_1},u_1) = (\underbrace{(s_2,t_2)}_{a_2},u_2)
$$
Using the "only if" condition in the law of ordered pairs, we deduce first that $(s_1,t_1)=a_1=a_2=(s_2,t_2)$ and $u_1=u_2$, and then we deduce further that $s_1=s_2$ and $t_1=t_2$. Then, using the "if" condition in the law of ordered pairs, we deduce that
$$\underbrace{(t_1,u_1)}_{c_1} = \underbrace{(t_2,u_2)}_{c_2}
$$
and further that
$$(s_1,(t_1,u_1)) = (s_1,c_1) = (s_2,c_2) = (s_2,(t_2,u_2))
$$
Intuitively, what this proof shows is that the "law of ordered pairs" implies a kind of "associative law of ordered triples".
A: Since the map $((s,t),u)\to(s,(t,u))$ is an isomorphism,  we can say that $(S×T)×U$ and $S×(T×U)$ are canonically isomorphic.  
A: The function $f:(S\times T)\times U\to S\times(T\times U)$ prescribed by $$\langle\langle s,t\rangle,u\rangle\mapsto\langle s,\langle t,u\rangle\rangle$$ is evidently surjective and can also be proved to be injective (can you do that?). 
So $f$ is a bijection whence represents a one-to-one correspondence between domain and codomain of $f$.
