45. Binary operations

45.1 Definition: binary operation

For any set $S$, a function $S\times S \to S$ is called a binary operation on $S$.

45.1.1 Remark The domain of a binary operation is the Cartesian square of its codomain. Thus a binary operation on a set $S$ is an element of the function set $S^{S\times S}$. In particular, a function $G: A\times B \to C$ is a binary operation only if $A=B=C$.

45.1.2 Example The function that takes $\langle 1,2\rangle$ to 1, and $\langle 1,1\rangle,\langle 2,1\rangle$ and $\langle 2,2\rangle$ all to 2 is a binary operation on the set $\{1,2\}$.

45.1.3 Example The usual operations of addition, subtraction and multiplication are binary operations on the set $\mathrm{R}$ of real numbers. Thus addition is the function

$$\langle x,y\rangle \mapsto x+y : \mathrm{R}\times\mathrm{R} \to \mathrm{R}$$

45.1.4 Example Division is a function from $\mathrm{R}\times(\mathrm{R}-\{0\})$ to $\mathrm{R}$, and so does not fit our definition of binary operation. Restricted to the nonzero reals, however, it is a function from $\mathrm{R}-\{0\}\times\mathrm{R}-\{0\}$ to $\mathrm{R}-\{0\}$ (this says if you divide a nonzero number by another one, you get a nonzero number), and so is a binary operation on $\mathrm{R}-\{0\}$.

45.1.5 Example For any set $A$, union and intersection are binary operations on $\mathcal{P}A$. This means that each of union and intersection is a function from $\mathcal{P}A\times\mathcal{P}A$ to $\mathcal{P}A$ (not from $A\times A$ to $A$).

45.1.6 Example For any set $A$, define the binary operation $P$ on $A$ by requiring that $aPb=b$ for all $a$ and $b$ in $A$. $P$ is called the right band on $A$.

45.1.7 Unary operations In the context of abstract algebra, a function from a set $A$ to $A$ is called a unary operation on $A$ by analogy with the concept of binary operation.

45.1.8 Example Taking the complement of a set is a unary operation on a powerset.

45.1.9 Example The function $-:\mathrm{Z}\to\mathrm{Z}$ (similarly for $\mathrm{R}$) that takes a number $r$ to its negative $-r$ is a unary operation on $\mathrm{R}$. This is distinct from the binary operation of subtraction $\langle m,n\rangle\mapsto m-n$.

Pages 67–68 of the book (PDF).