Semantics of operator $\times$ with regards to sets

139 Views Asked by At

I am trying to understand something about operator $\times$ with regards of sets. In the accepted answer to the following question (The cross product of two sets), the answerer says that $A \times B$ is the set of ordered pairs, taking their first element in $A$ and their second element in $B$.

So:

  • $\mathbb{N} \times \mathbb{N}$ is the set of all pairs $(x,y)$ with $x \in \mathbb{N}$ and $y \in \mathbb{N}$. It is also called $\mathbb{N}^2$.

But:

  • $\mathbb{N}^3$ is the set of all 3-tuples $(x,y,z)$ with $x \in \mathbb{N}$ and $y \in \mathbb{N}$ and $z \in \mathbb{N}$. But I have trouble saying it is $\mathbb{N} \times \mathbb{N} \times \mathbb{N}$.

Indeed, as few as I understand operators, I think $\times$ is a binary operator on sets, and as such, $\mathbb{N} \times \mathbb{N} \times \mathbb{N}$ should be read either as $(\mathbb{N} \times \mathbb{N}) \times \mathbb{N}$, or $\mathbb{N} \times (\mathbb{N} \times \mathbb{N})$, and have semantics:

  • $(\mathbb{N} \times \mathbb{N}) \times \mathbb{N}$ is the set of all pairs $((x,y),z)$ with $x \in \mathbb{N}$ and $y \in \mathbb{N}$ and $z \in \mathbb{N}$.
  • $\mathbb{N} \times (\mathbb{N} \times \mathbb{N})$ is the set of all pairs $(x,(y,z))$ with $x \in \mathbb{N}$ and $y \in \mathbb{N}$ and $z \in \mathbb{N}$.

But in no case can I construct a 3-tuple this way.

So my question is: what is the semantics of $\times$? Does it mean "take one element from each set and put them into a pair?" Or is it tuple concatenation, in which case there seems to be missing an operation that maps the set $\mathbb{N}$ to the set of 1-tuples taking thein values in $\mathbb{N}$?

And how do you concisely write the set of ordered triplets that take their first value in $\mathbb{N}$, their second value in $\mathbb{Z}$ and their third value in $\mathbb{R}$?

3

There are 3 best solutions below

11
On BEST ANSWER

The way that I learned set theory (I'm sure there are other entirely valid ways) we started with the following construction. Let $A, B, C, (A_i)_{i \in I}$ be sets.

Define $A \times B = \{(a, b) \mid a \in A, b \in B\}$. This is the usual cartesian product of sets (where, most likely, we define $(a, b) = \{a, \{a,b\}\}$). This is a well-defined construction, and as noted is not in any way associative. By inspection of elements in the corresponding sets, $A \times (B \times C) \neq (A \times B) \times C$.

To define ordered tuples of elements, we use a different construction entirely. Suppose that we want to define $A^I := \prod_{i \in I}A_i$ (where this is meant to refer to an ordered tuple of elements). The way we do this is via the following: $$ \prod_{i \in I}A_i = \Big\{ f: I \to \coprod_{i \in I}A_i \Big| f(i) \in A_i\Big\} $$ that is, we take it as the set of all functions from the index set to the disjoint union of the $A_i$ such that the value of $f(i) \in A_i$. For example, if $I = 3 = \{0,1,2\}$, and $A_i = \mathbb{N}$, then we would have $$ \mathbb{N}^3 = \big\{f : \{0,1,2\} \to \mathbb{N} \sqcup \mathbb{N} \sqcup\mathbb{N} \big| f(i) \in \mathbb{N}\big\} \cong \big\{f :\{0,1,2\} \to \mathbb{N}\big\} $$ which if you play around with this, you should see that this is just a somewhat strange description of the set of ordered triples of elements in $\mathbb{N}$.

Note that in this case the notation $\mathbb{N}^3$ makes perfect sense as a set of tuples, with no concern about associativity.

Now, you may ask why is my definition better than defining it as $\mathbb{N} \times(\mathbb{N} \times \mathbb{N})$ and just working with that?

Well, the point is that any sensible notion of ordered (say) triples will all be canonically in bijection with each other. That is, there is a bijection from my set $\mathbb{N}^3$ to your set $\mathbb{N} \times(\mathbb{N} \times \mathbb{N})$, and between these two and, say, $(\mathbb{N} \times \mathbb{N})\times\mathbb{N}$. In the end it doesn't actually matter which representation we choose, from the perspective of (most) properties we are interested in these three sets are indistinguishable from each other. So you can work with your favourite, I can work with mine, and we have (canonical) ways of translating between them.

Basically, we don't really care what $A \times B \times C$ is, as long as it behaves the way we think it ought to. The reason that we have these myriad constructions is just, in a sense, a way to ensure that something that looks like this actually does exist. Once we've done that, it is often best to forget about the details of the construction and think more about what you want that set to be able to do (generally, in relation to other sets).

2
On

Indeed, strictly speaking, $\times$ is not associative as an operator on sets. However, there are natural isomorphisms $(\mathbb{N}\times \mathbb{N})\times \mathbb{N}\simeq\mathbb{N}\times(\mathbb{N}\times\mathbb{N})\simeq\mathbb{N}\times\mathbb{N}\times\mathbb{N}\ $ given by flattening the parentheses, and this is good enough for most applications.

7
On

The difficulty here is that $X^3$ is not equal to either $(X \times X) \times X$ or $X \times (X \times X)$. To recall: $$\begin{align} X^3 & = \{ (x,y,z) : x \in X, y \in X, z \in X \} \\ (X \times X) \times X & = \{ ((x,y),z) : x \in X, y \in X, z \in X \} \\ X \times (X \times X) & = \{ (x,(y,z)) : x \in X, y \in X, z \in X \} \\ \end{align}$$ In fact none of these three sets are equal (unless $X = \emptyset$, a special case). However, there exist canonical bijections between the three, informally: $$ (x,y,z) \mapsto (x,(y,z)) \qquad (x,y,z) \mapsto ((x,y),z)$$ (Here the word "canonical" means that the three functors $\mathsf{Set} \to \mathsf{Set}$, $X \mapsto X^3$ (resp. $X \times (X \times X)$, resp. $(X \times X) \times X)$ are isomorphic. If you don't know what that means don't worry too much.)

So in day-to-day math we can just assume that these three sets are equal and use whichever representation is the most useful. But if you wanted to be perfectly precise and rigorous, they are actually different sets.