## Cardinality and Infinite Sets

In the proof of the Chinese Remainder Theorem, a key step was showing that two sets must have the same number of elements if we can find a way to "pair up" every element from one set with one and only one element from the other, and vice-versa. Notice, this idea gives us the ability to compare the "sizes" of sets without ever counting their elements.

For example, Grog the Caveman can tell -- without ever counting to four -- that the pile of rocks and the bunch of arrow-heads shown below are of the same "size" by pairing them up in the manner shown below, and noting that there was nothing left over from either group: Now think about sets of things that we have difficulty counting...
• How many integers are there?

• How many fractions exist? ... or real numbers?

• How many points lie on a plane?

One might say "infinitely many" in each case above -- but what does that really mean? More interestingly, can one of these infinite sets be fundamentally "bigger" than another in some way, or is every infinite set the "same size" as any other infinite set?

Let us adopt the mindset of Grog the Caveman. Let us say that two sets have the same "size" if a "pairing" between their elements exists.

We really need to be more precise here, as otherwise, the ambiguities of the English language might cause us problems.

To this end, let us adopt the following notation...

When we wish to discuss a function $f(x)$ which takes as inputs elements from a set $A$ (the domain of $f$) and outputs elements contained in some specified set $B$ (referred to as the co-domain for $f$), we write $$f : A \rightarrow B$$

Let us also make the following definitions:

$f : A \rightarrow B$ is injective if the only time $f(a_1)=f(a_2)$ happens is when $a_1=a_2$.

$f : A \rightarrow B$ is surjective (or onto) if given any element $b$ in set $B$, we can always find some element $a$ in $A$, so that $f(a)=b$.

$f : A \rightarrow B$ is a called a bijection (or one-to-one correspondence) if it is both injective and surjective.

The "pairings" we were talking about before can now be more precisely described as bijections.

Similarly, we define the cardinality of a set $A$, denoted $|A|$, as a more generalized version of the "size" of a set that allows for the discussion of sets with an infinite number of elements. Specifically, we define it in such a way so that:

1. Two sets $A$ and $B$ have the same cardinality ("size") if there exists a bijection ("pairing") between them.
2. Set $A$ has smaller cardinality than set $B$ if there is an injective function, but no bijective function, from $A$ to $B$.

Now, for the strange results that arise as a consequence of these definitions...

We can see that the set of natural numbers, $\{1,2,3,4...\}$, and the set of positive even numbers, $\{2,4,6,8...\}$, have the same cardinality (i.e., "size") as the bijective function $f(x)=2x$ takes elements from the former to the latter.

Similarly, we can see the the set of natural numbers, $\{1,2,3,4...\}$, have the same cardinality (i.e., "size") as the set of integers, $\{...,-4,-3,-2,-1,0,1,2,3,4...\}$, by finding the bijection shown below:
$$\begin{array}{c|c} x & f(x)\\\hline 1 & 0\\ 2 & 1\\ 3 & -1\\ 4 & 2\\ 5 & -2\\ 6 & 3\\ 7 & -3\\ \vdots & \vdots\\ \end{array}$$

Indeed, this last comparison reveals that any set that is "listable" (i.e., all of its elements can be written in a list) must have the same cardinality as the natural numbers. We call such sets countable. To make the argument that the cardinalities agree, simply define a function $f(x)$ where $f(1)$ is the first element in the list, $f(2)$ is the second element, $f(3)$ is the third, etc... This technique lies at the heart of Cantor's arguments that show the set of all rationals (i.e., fractions) also agrees with the cardinality of the natural numbers, while the set of reals are in some strange way, somehow fundamentally "bigger".
{"ft_lang_label":"__label__en","ft_lang_prob":0.9076797,"math_prob":0.9968392,"size":3224,"snap":"2021-31-2021-39","text_gpt3_token_len":875,"char_repetition_ratio":0.1173913,"word_repetition_ratio":0.03220036,"special_character_ratio":0.28722084,"punctuation_ratio":0.16193181,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9991233,"pos_list":[0,1,2,3,4,5,6],"im_url_duplicate_count":[null,null,null,null,null,1,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-07-30T19:50:42Z\",\"WARC-Record-ID\":\"<urn:uuid:1e32747e-46f4-4d03-89c9-1f9865a1392c>\",\"Content-Length\":\"8043\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:2f348eb0-5457-4b73-9eab-784b71516a95>\",\"WARC-Concurrent-To\":\"<urn:uuid:628f796f-6ebb-4bf4-bd42-5737ac85d41c>\",\"WARC-IP-Address\":\"170.140.54.85\",\"WARC-Target-URI\":\"http://mathcenter.oxford.emory.edu/site/math125/infiniteSets/\",\"WARC-Payload-Digest\":\"sha1:N6OI33YRKM3U7M3U5BENH2CMEFSM6HEG\",\"WARC-Block-Digest\":\"sha1:GZF5GL3P2GDTYPI5LWF25QIXR2XZSS3K\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-31/CC-MAIN-2021-31_segments_1627046153980.55_warc_CC-MAIN-20210730185206-20210730215206-00386.warc.gz\"}"}