# A bijection between $X \times (Y \times Z)$ and $(X \times Y) \times Z$

Can someone help me prove that $$X \times (Y \times Z) \sim (X \times Y) \times Z$$ I know that there is supposed to be a bijection between these two. The first one will contain elements like $(x, (y, z))$ and the second one $((x, y) z)$. I just need some instructions, I believe I can manage on my own from that.

• The way you've written the elements of each set should be really suggestive of what the bijection could be. – user296602 Jan 9 '16 at 17:10
• If you only need a bijection between sets (you didn't write what $X,Y, Z$ are), why not $(x,(y,z))\mapsto ((x,y),z)$? – user302982 Jan 9 '16 at 17:12
• yeah, but how am i going to proove that that's in fact a bijection? – Stefan Jan 9 '16 at 17:13
• Well, you need to prove it's injective and surjective. Here's an element of (X x Y) x Z: ((a, b), c). Can you write down something that is mapped to this element? – user296602 Jan 9 '16 at 17:19
• @DietrichBurde A stray * from **bold formatting** – user147263 Jan 9 '16 at 17:54

$$X \times (Y \times Z) = \{(x,(y,z)) \mid x \in X, y \in Y, z \in Z\}$$ $$(X \times Y) \times Z = \{ ((x,y),z) \mid x \in X, y \in Y, z \in Z \}$$
So consider the maps $(x,(y,z)) \mapsto ((x,y),z)$ and $((x,y),z) \mapsto (x,(y,z))$. One immediately verifies that these are indeed functions and they are clearly inverses, thus bijections.