Set operations

Remove members, pair values and describe mappings. Build on the set notation you have just learned.

Pair every choice with every other choice

Instead of removing members, we can combine choices. Choose a horizontal coordinate from $X=\{0,2\}$ and a vertical coordinate from $Y=\{1,3,4\}$. We want every allowed coordinate pair. The Cartesian product $X\times Y$ collects them.

$$X\times Y=\{(x,y):x\in X,\ y\in Y\}$$

The first coordinate comes from X and the second from Y, in that order.

First coordinatePairs with every second coordinate
0$(0,1),\ (0,3),\ (0,4)$
2$(2,1),\ (2,3),\ (2,4)$

Check membership and count

  1. The pair $(2,3)$ belongs because $2\in X$ and $3\in Y$. The pair $(3,2)$ fails both coordinate requirements.
  2. There are two choices for the first coordinate. Each pairs with three choices for the second, producing $2\cdot3=6$ distinct pairs.
  3. If Y were empty, there would be no second coordinate to choose. Thus $X\times\emptyset=\emptyset$.

The number of members of a finite set X is its cardinality, written $|X|$. For finite sets, $|X\times Y|=|X|\,|Y|$. These bars count members when they surround a set; around a real number, they denote absolute value.

An ordered pair is equal to another only when their corresponding coordinates agree. Therefore reversing factors generally changes the product. Its coordinates need not be numbers: a pair could also record a shirt size and a delivery day.

The notation $X^2$ means $X\times X$, not squaring each member. For our X, it gives $\{(0,0),(0,2),(2,0),(2,2)\}$. Three factors give triples: $X\times Y\times\{9\}$ contains six triples, including $(2,3,9)$. Keep nested parentheses when they are written: $((2,3),9)$ is a pair whose first member is itself a pair, rather than a three-coordinate tuple.

See the product as points, lines or an area

Plot the six pairs from $\{0,2\}\times\{1,3,4\}$. They make two columns of three dots. There is no point at $(1,3)$ because 1 is not an allowed first coordinate. Filling the gaps would silently change the set.

Fill one coordinate direction at a time

  1. Replace the second factor with $[1,4]$. The product $\{0,2\}\times[1,4]$ contains two full vertical segments, at $x=0$ and $x=2$. The point $(0,2.5)$ now belongs.
  2. Replace the first factor with $[0,2]$ as well. The product $[0,2]\times[1,4]$ contains every point satisfying $0\le x\le2$ and $1\le y\le4$. It is a filled rectangle.
  3. Replace $[1,4]$ with $[1,4)$. The top edge is excluded, including its corners, because every point there has the forbidden second coordinate 4.

The plane $\mathbb R^2=\mathbb R\times\mathbb R$ allows every real coordinate in both directions. The integer grid $\mathbb Z^2$ allows only integer coordinates. Mixing a discrete first factor with a continuous second factor gives separated vertical pieces: for example, $\mathbb N\times(-\infty,0)$ consists of downward rays at $x=1,2,3,\ldots$, with their points at $y=0$ excluded.

A product makes coordinate choices independently. The triangle from the previous submodule had the condition $x+y\le4$, which ties the choices together: at $x=3$, only $0\le y\le1$ is allowed. A single rectangle cannot express that changing vertical limit. In the next section, we will collect smaller sets to describe larger shapes.