two problem on homeomorphism and product of topological spaces 
*

*Let $\{(X_i, T_i) : i = 1,2,\ldots, n\}$ be a collection of topological spaces and let $\sigma$ be a permutation of the symbols $1, 2,\ldots, n$. For $i=1,2,\ldots, n$ let $Y_i = X_{ \sigma (i)}$ and let $Y = Y_1 \times Y_2 \times \ldots\times Y_n$ and $X = X_1 \times X_2\times\ldots \times X_n $, each with product topology. Prove that $X$ and $Y$ are homeomorphic to each other.    

*For any three spaces $X_1, X_2, X_3$ prove that $X_1\times(X_2 \times X_3)$ is homeomorphic to $(X_1\times X_2 )\times X_3$. 

Can anyone tell me please how can I tackle these problems?
 A: There is a more general approach to this problem. If may already have learned about the general construction of the topological product of spaces $X_i$, indexed by a set $I$. The set $X:=\prod_I X_i$ consists of all sequences $(x_i)_{i\in I}$. The word "sequence" is a bit misleading, it does not restrict to countable sequences. Think of this element as a map from $I$ to $\bigsqcup_I X_i$ such that to each $i\in I$ we assign an element $x_i\in X_i$. The product comes with projections $p_j:\prod_I X_i\to X_j$. We then equip $X$ with the coarsest topology such that the projections are continuous, namely the topology generated by the subbase $\{p_i^{-1}(U_i)\mid U_i\textrm{ open in }X_i,\ i\in I\}$. Defined this way, $X$ has the following property:

For each family of continuous maps $(f_i:Y\to X_i)_{i\in I}$ there is exactly one map $f:Y\to X$ such that $p_i\circ f=f_i$. This map is continuous since the compositions $p_i\circ f$ are continuous.

It is an easy exercise to show that if $Z$ is another space with projections $q_j:Z\to X_j$ satisfying the same property, then $Z$ is isomorphic to $X$.
This may help you solve the problems. If you want to prove that a space is homeomorphic to the product, show that it satisfies this universal property. For the second problem, this will give you isomorphisms $X_1\times(X_2\times X_3) \cong X_1\times X_2\times X_3 \cong (X_1\times X_2)\times X_3$
