# Unary and Binary Operations on Sets

Consider a set $S$. We can define various unary or binary operations on $S$. We define what exactly a unary and binary operation is as follows.

## Unary Operations

Definition: A Unary Operation on a set $S$ is a bijective function $f : S \to S$ |

For example, if we consider the set of integers $\mathbb{Z}$ then negation, $- : \mathbb{Z} \to \mathbb{Z}$, is an operation on $S$ that takes every $x \in \mathbb{Z}$ and maps it to its negative, $-x \in \mathbb{Z}$. For example, for $2 \in \mathbb{Z}$ we have that the negation of $2$ is $-2 \in \mathbb{Z}$.

As another example, if we consider the set of nonnegative real numbers $\mathbb{R}^+ \cup \{ 0 \}$ then the square root, $\sqrt{} : \mathbb{Z} \to \mathbb{Z}$ is an operation on $\mathbb{R}^+ \cup \{ 0 \}$ that takes every $x \in \mathbb{R}^+ \cap \{ 0 \}$ and maps it to $\sqrt{x} \in \mathbb{R}^+ \cup \{ 0 \}$. For example, for $9 \in \mathbb{R}^+ \cap \{ 0 \}$ we have that the square root of $9$ is $\sqrt{9} = 3 \in \mathbb{R}$.

## Binary Operations

Definition: A Binary Operation on a set $S$ is an operation on two operands (each pair $x, y \in S$) as a function $f : S \times S \to S$ such that for each $(x, y) \in S \times S$ we have that:1. $(x, y)$ is mapped into $S$, that is, $f(x, y) \in S$. 2. $f(x, y)$ is defined. 3. $(x, y)$ is mapped to only one element, $f(x, y) \in S$. |

It is very important to emphasize the three conditions above in defining a binary operation:

- Each pair $(x, y) \in S \times S$ must be mapped to an element in $S$.

- Each pair $(x, y) \in S \times S$ must be defined.

- Each pair $(x, y) \in S \times S$ cannot be assigned to more than one element in $S$.

The first condition above ensures that the operation $f$ is closed. The second and third conditions ensure that each pair $(x, y) \in S$ is associated with exactly one element in $S$.

For example, consider the set of real numbers $\mathbb{R}$. The binary operation on $\mathbb{R}$ that we are most familiar with is standard addition. For every $x, y \in \mathbb{R}$ we define standard addition of $x$ and $y$ by the function $f : \mathbb{R} \times \mathbb{R} \to \mathbb{R}$ given by:

(1)For example, the ordered pair $(2, 7) \in \mathbb{R} \times \mathbb{R}$ is mapped to $2 + 7 = 9 \in \mathbb{R}$ under $f$.

The binary operation of standard multiplication is also very familiar with us. For every $x, y \in \mathbb{R}$ we define standard multiplication of $x$ and $y$ by the function $g : \mathbb{R} \times \mathbb{R} \to \mathbb{R}$ given by:

(2)For example, the ordered pair $(3, 5) \in \mathbb{R} \times \mathbb{R}$ is mapped to $3 \cdot 5 = 15 \in \mathbb{R}$ under $g$.

For a more complicated example, consider the set of $2 \times 2$ matrices with real entries which we denote by $M_{22}$. Then we can define a binary operation of matrix addition as a function $f : M_{22} \times M_{22} \to M_{22}$ for all matrices $A, B \in M_{22}$ by:

(3)Similarly, we can define matrix multiplication on $M_{22}$ as the function $g : M_{22} \times M_{22} \to M_{22}$ for all matrices $A, B \in M_{22}$ by:

(4)Of course, we can also define our own operations. Consider the set of rational numbers $\mathbb{Q}$. For each $x, y \in \mathbb{Q}$ we have that $x = \frac{a}{b}$ and $y = \frac{a'}{b'}$ for $a, a', b, b' \in \mathbb{Z}$, $b, b' \neq 0$, and where $x$ and $y$ are written in lowest terms. We can define a binary operation $f : \mathbb{Q} \times \mathbb{Q} \to \mathbb{Q}$ as:

(5)For example, consider $\left (\frac{3}{5}, \frac{1}{7} \right ) \in \mathbb{Q} \times \mathbb{Q}$. Under our operation $f$ we have that:

(6)