# Set Notation with exponent

I am looking at the function:

$$f: \{5\}^2 \to \{5\}$$

it is certainly nothing too exceptional , but I find it difficult to understand what $\{5\}^2$ as a set notation and from then the whole function.

• I'd say it stands for the cartesian product of $\{5\}$ with itself: $$\{5\}^2=\{5\}\times\{5\}=\{(5,5)\}.$$ – Hirshy Jul 8 '15 at 19:12
• In general $X^2 = \{(x,y) : x,y \in X\}$. Hence, $\{5\}^2 = \{(5,5)\}$. – user 1987 Jul 8 '15 at 19:14
• Hirshy was right! However note that ${5}^2$ is just a notation and not the usual multiplication. – OKPALA MMADUABUCHI Jul 8 '15 at 19:15

Note that in general the exponent is a shorthand notation for applying the cartesian product a certain amount of times, eg: $X^2 = X \times X$, $X^3 = X \times X \times X$ and so on.
But another equivalent viewpoint that is sometimes used in set theory and theoretical computer science is to view $0 := \emptyset$, $1 := {0}$, $2 := {0,1}$ and so on and then view $X^Y$ as the set of all functions $f:Y \to X$. In the specific case of $X^2$ this is the same as all pairs of elements $(x,y)$ with $x,y \in X$. And for $2^X$ this conveniently is equal to the powerset. (Imagine each function as some choice function that tells you if an element is in the set or not; because you have all such functions this is the powerset).