Show there is a bijection between different definitions of Cartesian Product

• Definition.$$1$$
$$X\times_1 Y=\{ (x,y)=\{\{x\},\{x,y\}\}: x\in X, y\in Y\}$$
• Definition.$$2$$
$$X\times_2 Y=\left\{ f\in Fonk\left( \left\{ 0,1\right\},X\cup Y\right) : f(0)\in X, f(1)\in Y\right\}$$

Show there is a bijection between Definition $$1$$ of Cartesian Product and Definition $$2$$ of Cartesian Product.

My proof trying:
Let $$T$$ be a function from $$X\times_1 Y$$ to $$X\times_2 Y$$. We will show that $$T$$ is bijection.

Case 1:
One-to-one. Let $$a_1,a_2$$ be any elements of domain of $$T$$. Then, $$a_1$$ of the form is $$a_1:=(x_1,y_1)$$, and $$a_2$$ of the form is $$a_2:=(x_2,y_2)$$. We need to show $$T(a_1)=T(a_2)$$.
I couldn't continue my proof, can you help?

• I assume $Fonk(A,B)$ is the set of functoins $A\to B$ (more often written $B^A$)? – Hagen von Eitzen Nov 1 '18 at 11:52
• @HagenvonEitzen yes. – NewMoon Nov 1 '18 at 11:53
• Edited definitions. – NewMoon Nov 1 '18 at 11:55
• "Let $T$ be a function ... We will show that $T$ is a bijection" -- Taken literally, this cannot work. You better define a specific function $T$ instead of trying to show that any arbitrary function is a bijection – Hagen von Eitzen Nov 1 '18 at 11:56
• "Fonk" as functions? – Ennar Nov 1 '18 at 11:56

We can define \begin{align}T\colon X\times_2 Y&\to X\times_1 Y\\f&\mapsto(f(0),f(1))\end{align} (because $$f\in X\times_2 Y$$ implies $$f(0)\in X$$ and $$f(1)\in Y$$ as required).
Showing that $$T$$ is injective and surjective is straightforward. Alternatively, also define \begin{align}U\colon X\times_1 Y&\to X\times_2 Y\\(x,y)&\mapsto t\mapsto \begin{cases}x&t=0\\y&t=1\end{cases}\end{align} and show that $$U\circ T$$ and $$T\circ U$$ are the identities on the two versions of product.