Tuples

This chapter provides notes on ordered pairs and tuples.

When set theory was first introduced, it faced a major issueβ€”how do you represent ordered pairs? That is, given the set { a,b },{\set{a,b},} how do you communicate that a{a} is first and b{b} is second, purely in the language of set theory?

Sets, by definition, are unordered. Thus, { a,b }{\set{a,b}} is the same set as { b,a }.{\set{b,a}.} This is problematic because we have no way of communicating "a{a} then b{b}" purely in the language of set theory β€” there's no way to distinguish between { a,b }{\set{a,b}} and { b,a }.{\set{b,a}.}

Ordered Pairs

In 1921, the Polish logician Kazimierz Kuratowski offered the following definition:

ordered pair. An ordered pair, denoted (a,b),{(a,b),} is defined as:

(a,b)={ { a },{ a,b } } (a,b) = \set{ \set{a}, \set{a,b}}

This is one of the greatest examples of "working with what you've got" and the extent of mathematical cleverness. Kuratowski essentially said: "Why are we so concerned about which goes first and which goes second? It's unnecessary." And he had a point. The notion of "first" and "second" is entirely relative.

Suppose we had two objects side by side.

aΒ Β Β b \large a ~~~ b

If we read from left to right, a{a} is first and b{b} is second. If we read from right to left β€” a perfectly permissible thing to do β€” then b{b} is first and a{a} is second. If we read it from top to bottom β€” again perfectly permissible β€” then, well, all bets are off. Kuratowski was astute enough to realize that searching for a way to define "first" and "second" was a zero sum game. Even if we managed to establish a rigorous definition for "first" and "second," the situation wouldn't change because there would always be an alternative view.

To Kuratowski, the notions of "first" and "second" are just convenient ways of achieving what we're really after: A way of communicating the idea that

aΒ Β Β b \large a~~~b

is different from

bΒ Β Β a. \large b~~~a.

Thus, we don't need a way to establish what's first or second. What we need is a way to distinguish between two sets. If we look at Kuratowski's definition, it does exactly that. Let's say a=0{a = 0} and b=1.{b = 1.} Then, by Kuratowski's definition, we have:

(0,1)={ { 0 },{ 0,1 } } (0,1) = \set{ \set{0}, \set{0,1}}

Now let's say a=1{a = 1} and b=0.{b = 0.} Then we have:

(1,0)={ { 1 },{ 1,0 } } (1,0) = \set{ \set{1}, \set{1,0}}

Looking at the two sets, we see that they are, in fact, different:

(0,1)={ { 0 },{ 0,1 } }(1,0)={ { 1 },{ 1,0 } } (0,1) = \set{ \set{0}, \set{0,1}} \\ (1,0) = \set{ \set{1}, \set{1,0}}

Because we have a way of distinguishing between (a,b){(a,b)} and (b,a),{(b,a),} the notion of "first" and "second" is just a cherry on top, and it just so happens that we prefer interpreting (a,b){(a,b)} as "a{a} is first, and b{b} is second."

An added benefit of Kuratowski's definition is that it allows us to state when two ordered pairs are equal:

equality of ordered pairs. Let (a,b)(a,b) and (c,d)(c,d) be ordered pairs. Then

(a,b)=(c,d) (a,b) = (c,d)

if, and only if,

a=cΒ Β Β andΒ Β Β b=d a = c ~~~\text{and}~~~ b = d

Tuples

Ordered pairs allow us to express a pair (a,b).{(a,b).} But what if we want to express something like:

(a,b,c) (a,b,c)

Well, we can take a similar approach to Kuratowski's. But instead of nesting a set, we'll nest an ordered pair:

(a,(b,c)) (a, (b,c))

Again, what's important is that we have a way of distinguishing the set represented by the expression above and some other set. If we expanded the above expression, we'd get:

{ { a },{ a,{ { b },{ b,c } } } } \set{\set{a}, \set{a, \set{\set{b}, \set{b,c}}}}

Once more, we still have a way to differentiate between sets. Suppose a=1,{a=1,} b=2,{b=2,} and c=3.{c=3.} Then:

(1,2,3)={ { 1 },{ 1,{ { 2 },{ 2,3 } } } } (1,2,3)=\set{\set{1}, \set{1, \set{\set{2}, \set{2,3}}}}

Now suppose a=1,b=3,c=2.{a=1,b=3,c=2.} Then:

(1,3,2)={ { 1 },{ 1,{ { 3 },{ 3,2 } } } } (1,3,2)=\set{\set{1}, \set{1, \set{\set{3}, \set{3, 2}}}}

Those are very clearly different sets. The fact that we're simply nesting ordered pairs allows us to extend the same idea to n{n} elements.

(1,2,3,4,…,n) (1,2,3,4,\ldots,n)

We call the construct above an n{n}-tuple. Notice that this effectively generalizes the notion of an ordered pair β€” an ordered pair is simply a 2-tuple.

n-tuple. Where n∈N,{n \in \nat,} the collection:

(a1,a2,a3,…,an)={βˆ…Β Β ifΒ Β n=0(a1,(a2,a3,…,an))Β Β elseΒ Β (a_1,a_2,a_3,\ldots,a_n) = \begin{cases} \nil & ~~\text{if}~~ n = 0 \\[1em] (a_1, (a_2, a_3, \ldots, a_n)) & ~~\text{else}~~ \end{cases}

is called an n{n}-tuple.

The Cartesian Product

With the notion of tuples, we can now represent a wide variety of objects mathematically. Suppose we have two sets:

A={ x,y,z }Β Β Β Β B={ 1,2,3 } A = \set{x,y,z} ~~~~ B = \set{1,2,3}

Now that we have tuples, we can create a set that contains all the possible 2-tuples (a,b),{(a,b),} where a∈A{a \in A} and b∈B.{b \in B.} Let's explicitly lay out that set:

AΓ—B={(x,1),(x,2),(x,3)(y,1),(y,2),(y,3)(z,1),(z,2),(z,3)} A \times B = \lset{ \eqs{ & (x,1), & (x,2), && (x,3) & \\ & (y,1), & (y,2), && (y,3) & \\ & (z,1), & (z,2), && (z,3) & } }

More explicitly:

Cartesian Product. Let A{A} and B{B} be sets. The set

AΓ—B A \times B

is the set of all tuples (a,b),{(a,b),} where a∈A{a \in A} and b∈B.{b \in B.}

Because we have the notion of n{n}-tuples, we can also define the Cartesian product generally:

General Definition of the Cartesian Product. The A1,A2,…,An{A_1, A_2, \ldots, A_n} be sets. The Cartesian product of the sets A1,A2,…,An,{A_1, A_2, \ldots, A_n,} denoted

A1Γ—A2×…×An, A_1 \times A_2 \times \ldots \times A_n,

is the set of all n{n}-tuples (a1,a2,…,an){(a_1, a_2, \ldots, a_n)} where ai∈Ai{a_i \in A_i} for i=1,2,…,n.{i = 1,2,\ldots,n.} That is,

A1Γ—A2×…×An={ (a1,a2,…,an):ai∈AiΒ forΒ i=1,2,3,…,n } \small A_1 \times A_2 \times \ldots \times A_n = \set{(a_1,a_2,\ldots,a_n) : a_i \in A_i \text{ for } i=1,2,3,\ldots,n}

Cardinality of the Cartesian Product

Given that the Cartesian product is the set of all tuples (a1,a2,…,an){(a_1, a_2, \ldots, a_n)} where a∈A1,{a \in A_1,} a2∈A2,{a_2 \in A_2,} …,{\ldots,} an∈An{a_n \in A_n} with n∈N,{n \in \nat,} we have the following theorem.

cardinality of the cartesian product. Let A1,A2,…An{A_1, A_2, \ldots A_n} be sets, with n∈N.{n \in \nat.} Then

#(A1Γ—A2×…×An)=#(A1)Γ—#(A2)…×#(An). \card{(A_1 \times A_2 \times \ldots \times A_n)} = \card{(A_1)} \times \card{(A_2)} \ldots \times \card{(A_n).}

For example, given the set B={ 0,1 },{B = \set{0,1},} then the cardinality of BΓ—B{B \times B} is 4,{4,} since:

BΓ—B={(0,0)Β Β (0,1)(1,0)Β Β (1,1)}. B \times B = \lset{ \eqs{ (0,0)~&~(0,1) \\ (1,0)~&~(1,1) } }.