### Transformation

##### 5. Graph of transformation

Our more precise definition of transformations is in fact still not up to the rigorous standard of mathematics. The formal mathematical definition of transformations relies on set theory. We need to use the basic concepts such as set, elements of a set, subset, and the cartesian product of two sets

**X**×**Y** = {(`x`, `y`): `x` ∈ **X**, `y` ∈ **Y**}.

Now we can present the formal definition of transformations.

A transformation from a set **X** to another set **Y** is a subset **T** of **X**×**Y** satisfying the following property.

For any `x` ∈ **X**, there is a unique `y` ∈ **Y** such that (`x`, `y`) ∈ **T**.

The unique `y` in the definition is completely determined by `x`. It is the value of `y` under the transformation **T** and is denoted as **T**(`x`). What we have done is basically define a transformation **T** by its graph {(`x`, **T**(`x`)): all `x` ∈ **X**}.

Example The identity transformation `id`(`x`) = `x`: **X** → **X** is defined as the diagonal subset `Δ`_{X} = {(`x`, `x`): all `x` ∈ **X**}.

For a fixed `b` ∈ **Y**, the constant transformation **C**(`x`) = `b`: **X** → **Y** is defined as the subset **X**×`b` = {(`x`, `b`): all `x` ∈ **X**}.

Example The transformation `Square`(x) = `x`^{2}: **R** → **R** is defined as the parabola {(`x`, `x`^{2}): all `x` ∈ **R**} in the plane.

Two transformations **T** and **S** are equal if they have the same source **X** and the same target **Y**, and the subsets **T** and **S** of **X**×**Y** are equal. The following result shows that this definition is consistent with our intuition.

For transformations **T** and **S** from **X** to **Y**, the following are equivalent.

**T** = **S** (as subsets of **X**×**Y**).
**T** ⊂ **S** (as subsets of **X**×**Y**).
**T**(`x`) = **S**(`x`) for all `x` ∈ **X**.

Proof The first property trivially implies the second.

Assume **T** ⊂ **S**. For any `x` ∈ **X**, since **T** is a transformation, we have `y` = **T**(`x`) ∈ **Y** such that (`x`, `y`) ∈ **T**. Then applying **T** ⊂ **S**, we also have (`x`, `y`) ∈ **S**. This means `y` = **S**(`x`). Thus we have proved **T**(`x`) = `y` = **S**(`x`).

Finally, the third property implies the first because the subsets, being the graphs of the transformations, are completely determined by the values of the transformations.