Source and provenance
These are all 14 files in the frozen The Size of Sets source boundary, shown line by line and copied byte-for-byte for download. The reading views bind all 1082 formula occurrences to their exact source locations.
Source label and reader link correction
Editorial projection note: the source gives this alternate exercise the same link label as the corresponding exercise in the earlier Reduction section. This edition assigns the alternate copy its own link target; unqualified references lead to the earlier copy. The canonical source is unchanged.
The preserved source below still shows the duplicate at reduction-alt.tex line 106 and the primary definition at reduction.tex line 108. The reading views use the four-character derived-stream correction and keep the earlier exercise as the target of unqualified references.
Open the derived reading stream. Open the exact correction sidecar.
content/sets-functions-relations/size-of-sets/comparing-size.tex
150 lines; SHA-256 cb92c7e6df9529ced700d708ad8c6efda9a0d8c3f8e69d08bcb4d614c6f5041b. Open the preserved source file.
% Part:sets-functions-relations% Chapter: size-of-sets% Section: comparing-sizes\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\olfileid{sfr}{siz}{car}\olsection{Sets of Different Sizes, and Cantor's Theorem}\begin{explain}We have offered a precise statement of the idea that two sets have thesame size. We can also offer a precise statement of the idea that oneset is smaller than another. Our definition of ``is smaller than (orequinumerous)'' will require, instead of !!a{bijection} between thesets, !!a{injection} from the first set to the second. If such afunction exists, the size of the first set is less than or equal tothe size of the second. Intuitively, !!a{injection} from one set toanother guarantees that the range of the function has at least as many!!{element}s as the domain, since no two !!{element}s of the domainmap to the same !!{element} of the range.\end{explain}\begin{defn}$A$ is \emph{no larger than}~$B$, written $\cardle{A}{B}$, iff thereis !!a{injection} $f \colon A \to B$.\end{defn}It is clear that this is a reflexive and transitive relation, but thatit is not symmetric (this is left as an exercise). We can alsointroduce a notion, which states that one set is (strictly) smallerthan another.\begin{defn}$A$ is \emph{smaller than}~$B$, written $\cardless{A}{B}$, iff thereis !!a{injection}~$f\colon A \to B$ but no !!{bijection}~$g\colon A\to B$, i.e., $\cardle{A}{B}$ and $\cardneq{A}{B}$.\end{defn}It is clear that this relation is irreflexiveand transitive. (This is left as an exercise.) Using this notation, wecan say that a set $A$ is !!{enumerable} iff $\cardle{A}{\Nat}$, andthat $A$ is !!{nonenumerable} iff $\cardless{\Nat}{A}$. This allows usto restate\oliflabeldef{sfr:siz:nen-alt:thm:nonenum-pownat}{%\olref[sfr][siz][nen-alt]{thm:nonenum-pownat}as the observation that$\cardless{\Nat}{\Pow{\Nat}}$}{%\olref[sfr][siz][nen]{thm:nonenum-pownat}as the observation that $\cardless{\PosInt}{\Pow{\PosInt}}$}. In fact,\citet{Cantor1892} proved that this last point is \emph{perfectlygeneral}:\begin{thm}[Cantor]\ollabel{thm:cantor}$\cardless{A}{\Pow{A}}$, for any set $A$.\end{thm}\begin{proof}The map $f(x) = \{x\}$ is !!a{injection} $f \colon A \to \Pow{A}$,since if $x \neq y$, then also $\{x\} \neq \{y\}$ by extensionality,and so $f(x) \neq f(y)$. So we have that $\cardle{A}{\Pow{A}}$.\begin{editorial}We present the slow proof if \olref[nen]{sec} ispresent, otherwise a faster proof matching \olref[nen-alt]{sec}.\end{editorial}\oliflabeldef{sfr:siz:nen:sec}{%We will now show that there cannot be !!a{surjective} function~$g\colon A \to\Pow{A}$, let alone !!a{bijective} one, and hence that$\cardneq{A}{\Pow{A}}$. For suppose that $g\colon A \to \Pow{A}$.Since $g$ is total, every $x \in A$ is mapped to a subset $g(x)\subseteq A$. We can show that $g$ cannot be surjective. To do this, wedefine a subset~$\overline{A} \subseteq A$ which by definition cannot be in therange of~$g$. Let\[\overline{A} = \Setabs{x \in A}{x \notin g(x)}.\]Since $g(x)$ is defined for all $x \in A$, $\overline{A}$ is clearlya well-defined subset of~$A$. But, it cannot be in the rangeof~$g$. Let $x \in A$ be arbitrary, we will show that $\overline{A} \neqg(x)$. If $x \in g(x)$, then it does not satisfy $x \notin g(x)$,and so by the definition of~$\overline{A}$, we have $x \notin\overline{A}$. If $x \in \overline{A}$, it must satisfy thedefining property of~$\overline{A}$, i.e., $x \in A$ and $x \noting(x)$. Since $x$ was arbitrary, this shows that for each $x \in\overline{A}$, $x \in g(x)$ iff $x \notin \overline{A}$, and so$g(x) \neq \overline{A}$. In other words, $\overline{A}$ cannot bein the range of~$g$, contradicting the assumption that~$g$ issurjective.}{It remains to show that $\cardneq{A}{\Pow{A}}$. Forreductio, suppose $\cardeq{A}{\Pow{A}}$, i.e., there is some!!{bijection} $g \colon A \to \Pow{A}$. Now consider:\[D = \Setabs{x \in A}{x \notin g(x)}\]Note that $D \subseteq A$, so that $D \in \Pow{A}$. Since $g$ is!!a{bijection}, there is some $y \in A$ such that $g(y) = D$. Butnow we have:\[y \in g(y) \text{ iff } y \in D \text{ iff } y \notin g(y).\]This is a contradiction; so $\cardneq{A}{\Pow{A}}$.}{}\end{proof}\begin{explain}\oliflabeldef{sfr:siz:nen:thm:nonenum-pownat}{It's instructive tocompare the proof of \olref{thm:cantor} to that of\olref[nen]{thm:nonenum-pownat}. There we showed that for any list$Z_1$, $Z_2$, \dots, of subsets of~$\PosInt$ one can construct aset~$\overline{Z}$ of numbers guaranteed not to be on the list. Itwas guaranteed not to be on the list because, for every $n \in\PosInt$, $n \in Z_n$ iff $n \notin \overline{Z}$. This way, thereis always some number that is !!a{element} of one of $Z_n$ or$\overline{Z}$ but not the other. We follow the same idea here,except the indices~$n$ are now !!{element}s of~$A$ insteadof~$\PosInt$. The set $\overline{A}$ is defined so that it isdifferent from~$g(x)$ for each $x \in A$, because $x \in g(x)$ iff$x \notin \overline{A}$. Again, there is always !!a{element} of~$A$which is !!a{element} of one of $g(x)$ and $\overline{A}$ but notthe other. And just as $\overline{Z}$ therefore cannot be on thelist $Z_1$, $Z_2$, \dots, $\overline{A}$ cannot be in the rangeof~$g$.}{}\oliflabeldef{sfr:siz:nen-alt:thm:nonenum-pownat}{It's instructive tocompare the proof of \olref{thm:cantor} to that of\olref[nen-alt]{thm:nonenum-pownat}. There we showed that for anylist $N_0$, $N_1$, $N_2$, \dots, of subsets of~$\Nat$ we can construct aset~$D$ of numbers guaranteed not to be on the list. It wasguaranteed not to be on the list because $n \in N_n$ iff $n \notinD$, for every $n \in \Nat$. We follow the same idea here, except theindices~$n$ are now !!{element}s of~$A$ rather than of~$\Nat$. Theset $D$ is defined so that it is different from~$g(x)$ for each $x\in A$, because $x \in g(x)$ iff $x \notin D$.}{}The proof is also worth comparing with the proof of Russell's Paradox,\olref[sfr][set][rus]{thm:russells-paradox}. Indeed, Cantor's Theorem wasthe inspiration for Russell's own paradox.\end{explain}\begin{prob}Show that there cannot be !!a{injection} $g\colon \Pow{A} \toA$, for any set~$A$. Hint: Suppose $g\colon \Pow{A} \to A$ is!!{injective}. Consider $D = \Setabs{g(B)}{B \subseteq A \text{ and} g(B) \notin B}$. Let $x = g(D)$. Use the fact that $g$ is!!{injective} to derive a contradiction.\end{prob}\end{document}
content/sets-functions-relations/size-of-sets/enumerability-alt.tex
135 lines; SHA-256 8ad8d8941a5ca6d1b4cd2cc351fc16a912d00273783c0358838dd4fa51fb4627. Open the preserved source file.
% Part:sets-functions-relations% Chapter: size-of-sets% Section: enumerations-alt\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\olfileid{sfr}{siz}{enm-alt}\olsection{Enumerations and \usetoken{S}{enumerable} Sets}\begin{editorial}This section defines enumerations as bijections with (initialsegments) of $\Nat$, the way it's done in set theory. So itconflicts slightly with the definitions in \olref[enm]{sec}, andrepeats all the examples there. It is also a bit more terse thanthat section.\end{editorial}We can specify finite set is by simply enumerating its!!{element}s. We do this when we define a set like so:\[A = \{a_1, a_2, \ldots, a_n\}.\]Assuming that the !!{element}s $a_1$, \dots, $a_n$ are all distinct,this gives us !!a{bijection} between $A$ and the first $n$ naturalnumbers $0$, \dots, $n-1$. Conversely, since every finite set has onlyfinitely many !!{element}s, every finite set can be put into such acorrespondence. In other words, if $A$ is finite, there is!!a{bijection} between $A$ and $\{0, \dots, n-1\}$, where $n$ is thenumber of !!{element}s of~$A$.If we allow for certain kinds of infinite sets, then we will alsoallow some infinite sets to be enumerated. We can make this precise bysaying that an infinite set is enumerated by !!a{bijection} between itand all of~$\Nat$.\begin{defn}[Enumeration, set-theoretic]An \emph{enumeration} of a set $A$ is !!a{bijection} whose range is$A$ and whose domain is either an initial set of natural numbers $\{0,1, \ldots, n\}$ {or} the entire set of natural numbers~$\Nat$.\end{defn}\begin{explain}There is an intuitive underpinning to this use of the word\emph{enumeration}. For to say that we have enumerated a set $A$ is tosay that there is !!a{bijection} $f$ which allows us to count out theelements of the set $A$. The $0$th element is $f(0)$, the 1st is$f(1)$, \ldots the $n$th is $f(n)$\ldots.\footnote{Yes, we countfrom $0$. Of course we could also start with~$1$. This wouldmake no big difference. We would just have to replace~$\Nat$by~$\PosInt$.} The rationale for this may be made even clearer byadding the following:\end{explain}\begin{defn}\ollabel{defn:enumerable}A set~$A$ is !!{enumerable} iff either $A = \emptyset$ or there isan enumeration of~$A$. We say that $A$ is !!{nonenumerable} iff $A$is not !!{enumerable}.\end{defn}\begin{explain}So a set is !!{enumerable} iff it is empty or you can use anenumeration to count out its !!{element}s.\end{explain}\begin{ex}A function enumerating the natural numbers is simply the identityfunction $\Id{\Nat} \colon \Nat \to \Nat$ given by $\Id{\Nat}(n) = n$. Afunction enumerating the \emph{positive} natural numbers, $\Nat^+ =\Nat \setminus \{0\}$, is the function $g(n) = n + 1$, i.e., thesuccessor function.\end{ex}\begin{prob}Show that a set $A$ is !!{enumerable} iff either $A = \emptyset$ orthere is !!a{surjection} $f\colon \Nat \to A$. Show that $A$ is!!{enumerable} iff there is !!a{injection} $g\colon A \to \Nat$.\end{prob}\begin{ex}The functions $f\colon \Nat \to \Nat$ and $g \colon \Nat \to \Nat$given by\begin{align*}f(n) & = 2n \text{ and}\\g(n) & = 2n+1\end{align*}respectively enumerate the even natural numbers and the odd naturalnumbers. But neither is !!{surjective}, so neither is an enumerationof $\Nat$.\end{ex}\begin{prob}Define an enumeration of the square numbers $1$, $4$, $9$, $16$, \dots\end{prob}\begin{ex}Let $\lceil x \rceil$ be the \emph{ceiling} function, which rounds $x$up to the nearest integer. Then the function $f \colon \Nat \to \Int$given by:\[f(n) = (-1)^{n} \left\lceil\tfrac{n}{2}\right\rceil\]enumerates the set ofintegers~$\Int$ as follows:\[\begin{array}{c c c c c c c c}f(0) & f(1) & f(2) & f(3) & f(4) & f(5) & f(6) & \dots \\ \\\big\lceil \tfrac{0}{2} \big\rceil & -\big\lceil \tfrac{1}{2}\big\rceil & \big\lceil \tfrac{2}{2} \big\rceil & -\big\lceil \tfrac{3}{2} \big\rceil & \big\lceil \tfrac{4}{2} \big\rceil & -\big\lceil \tfrac{5}{2}\big\rceil & \big\lceil \tfrac{6}{2} \big\rceil & \dots \\ \\0 & -1 & 1 & -2 & 2 & -3 & 3& \dots\end{array}\]Notice how $f$ generates the values of $\Int$ by ``hopping'' back andforth between positive and negative integers. You can also think of$f$ as defined by cases as follows:\[f(n) = \begin{cases}\frac{n}{2} & \text{if $n$ is even}\\-\frac{n+1}{2} & \text{if $n$ is odd}\end{cases}\]\end{ex}\begin{prob}Show that if $A$ and $B$ are !!{enumerable}, so is $A \cup B$.\end{prob}\begin{prob}Show by induction on $n$ that if $A_1$, $A_2$, \dots, $A_n$ are all!!{enumerable}, so is $A_1 \cup \dots \cup A_n$.\end{prob}\end{document}
content/sets-functions-relations/size-of-sets/enumerability.tex
279 lines; SHA-256 7657db317a07eef9cd5497ad88997483dd43c9f94f27d257abe857084886a2fe. Open the preserved source file.
% Part:sets-functions-relations% Chapter: size-of-sets% Section: enumerations\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\olfileid{sfr}{siz}{enm}\olsection{Enumerations and \usetoken{S}{enumerable} Sets}\begin{editorial}This section discusses enumerations of sets, defining them assurjections from $\PosInt$. It does things slowly, for readers withlittle mathematical background. An alternative, terserversion is given in \olref[enm-alt]{sec}, which defines enumerationsdifferently: as bijections with $\Nat$ (or an initial segment).\end{editorial}\begin{explain}We've already given examples of sets by listing their !!{element}s.Let's discuss in more general terms how and when we can list the!!{element}s of a set, even if that set is infinite.\end{explain}\begin{defn}[Enumeration, informally]Informally, an \emph{enumeration} of a set~$A$ is a list (possiblyinfinite) of !!{element}s of~$A$ such that every !!{element} of $A$appears on the list at some finite position. If $A$ has anenumeration, then $A$ is said to be \emph{!!{enumerable}}.\end{defn}\begin{explain}A couple of points about enumerations:\begin{enumerate}\item We count as enumerations only lists which have a beginning andin which every !!{element} other than the first has a single!!{element} immediately preceding it. In other words, there areonly finitely many elements between the first !!{element} of thelist and any other !!{element}. In particular, this means that every!!{element} of an enumeration has a finite position: the first!!{element} has position~$1$, the second position~$2$, etc.\item We can have different enumerations of the same set~$A$ whichdiffer by the order in which the !!{element}s appear: $4$, $1$,$25$, $16$,~$9$ enumerates the (set of the) first five squarenumbers just as well as $1$, $4$, $9$, $16$,~$25$ does.\item Redundant enumerations are still enumerations: $1$, $1$, $2$,$2$, $3$, $3$,~\dots{} enumerates the same set as $1$, $2$,$3$,~\dots{} does.\item Order and redundancy \emph{do} matter when we specify anenumeration: we can enumerate the positive integers beginning with$1$, $2$, $3$, $1$, \dots{}, but the pattern is easier to see whenenumerated in the standard way as $1$, $2$, $3$, $4$,~\dots\item Enumerations must have a beginning: \dots, $3$, $2$, $1$ is notan enumeration of the positive integers because it has no first!!{element}. To see how this follows from the informal definition,ask yourself, ``at what position in the list does the number 76appear?''\item The following is not an enumeration of the positive integers:$1$, $3$, $5$, \dots, $2$, $4$, $6$, \dots\@ The problem is that theeven numbers occur at places $\infty + 1$, $\infty + 2$, $\infty +3$, rather than at finite positions.\item The empty set is enumerable: it is enumerated by the empty list!{}\end{enumerate}\end{explain}\begin{prop}If $A$ has an enumeration, it has an enumeration withoutrepetitions.\end{prop}\begin{proof}Suppose $A$ has an enumeration $x_1$, $x_2$, \dots{} in which each$x_i$ is an !!{element} of~$A$. We can remove repetitions from anenumeration by removing repeated !!{element}s. For instance, we canturn the enumeration into a new one in which we list $x_i$ ifit is !!a{element} of~$A$ that is not among $x_1$, \dots,$x_{i-1}$ or remove $x_i$ from the list if it already appears among$x_1$, \dots,~$x_{i-1}$.\end{proof}The last argument shows that in order to get a good handle onenumerations and !!{enumerable} sets and to prove things about them,we need a more precise definition. The following provides it.\begin{defn}[Enumeration, formally]An \emph{enumeration} of a set $A \neq \emptyset$ is any!!{surjective} function $f \colon \PosInt \to A$.\end{defn}\begin{explain}Let's convince ourselves that the formal definition and the informaldefinition using a possibly infinite list are equivalent. First, any!!{surjective} function from $\PosInt$ to a set~$A$ enumerates~$A$.Such a function determines an enumeration as defined informally above:the list $f(1)$, $f(2)$, $f(3)$, \dots. Since $f$ is !!{surjective},every !!{element} of~$A$ is guaranteed to be the value of~$f(n)$ forsome~$n \in \PosInt$. Hence, every !!{element} of $A$ appears at somefinite position in the list. Since the function may not be!!{injective}, the list may be redundant, but that is acceptable (asnoted above).On the other hand, given a list that enumerates all !!{element}sof~$A$, we can define !!a{surjective} function $f\colon \PosInt \to A$by letting $f(n)$ be the $n$th !!{element} of the list, or the final!!{element} of the list if there is no $n$th !!{element}. The onlycase where this does not produce !!a{surjective} function is when $A$ isempty, and hence the list is empty. So, every non-empty listdetermines !!a{surjective} function $f\colon \PosInt \to A$.\end{explain}\begin{defn}\ollabel{defn:enumerable}A set~$A$ is !!{enumerable} iff it is empty or has an enumeration.\end{defn}\begin{ex}A function enumerating the positive integers ($\PosInt$) is simply theidentity function given by $f(n) = n$. A function enumerating thenatural numbers $\Nat$ is the function $g(n) = n - 1$.\end{ex}\begin{ex}The functions $f\colon \PosInt \to \PosInt$ and $g \colon \PosInt \to\PosInt$ given by\begin{align*}f(n) & = 2n \text{ and}\\g(n) & = 2n - 1\end{align*}enumerate the even positive integers and the odd positive integers,respectively. However, neither function is an enumeration of$\PosInt$, since neither is !!{surjective}.\end{ex}\begin{prob}Define an enumeration of the positive squares $1$, $4$, $9$, $16$, \dots\end{prob}\begin{ex}The function $f(n) = (-1)^{n} \lceil \frac{(n-1)}{2}\rceil$ (where$\lceil x \rceil$ denotes the \emph{ceiling} function, which rounds$x$ up to the nearest integer) enumerates the set ofintegers~$\Int$. Notice how $f$ generates the values of $\Int$ by``hopping'' back and forth between positive and negative integers:\[\begin{array}{c c c c c c c c}f(1) & f(2) & f(3) & f(4) & f(5) & f(6) & f(7) & \dots \\ \\- \lceil \tfrac{0}{2} \rceil & \lceil \tfrac{1}{2}\rceil & - \lceil \tfrac{2}{2} \rceil & \lceil \tfrac{3}{2} \rceil & - \lceil \tfrac{4}{2} \rceil & \lceil \tfrac{5}{2}\rceil & - \lceil \tfrac{6}{2} \rceil & \dots \\ \\0 & 1 & -1 & 2 & -2 & 3 & \dots\end{array}\]You can also think of $f$ as defined by cases as follows:\[f(n) = \begin{cases}0 & \text{if $n = 1$}\\n/2 & \text{if $n$ is even}\\-(n-1)/2 & \text{if $n$ is odd and $>1$}\end{cases}\]\end{ex}\begin{prob}Show that if $A$ and $B$ are !!{enumerable}, so is $A \cup B$. To dothis, suppose there are !!{surjective} functions $f\colon \PosInt \toA$ and $g\colon \PosInt \to B$, and define !!a{surjective}function~$h\colon \PosInt \to A \cup B$ and prove that it is!!{surjective}. Also consider the cases where $A$ or~$B = \emptyset$.\end{prob}\begin{prob}Show that if $B \subseteq A$ and $A$ is !!{enumerable}, so is~$B$. Todo this, suppose there is !!a{surjective} function $f\colon \PosInt \toA$. Define !!a{surjective} function~$g\colon \PosInt \to B$ and provethat it is !!{surjective}. What happens if $B = \emptyset$?\end{prob}\begin{prob}Show by induction on $n$ that if $A_1$, $A_2$, \dots, $A_n$ are all!!{enumerable}, so is $A_1 \cup \dots \cup A_n$. You may assume thefact that if two sets $A$ and~$B$ are !!{enumerable}, so is~$A \cupB$.\end{prob}Although it is perhaps more natural when listing the !!{element}s of aset to start counting from the $1$st !!{element}, mathematicians liketo use the natural numbers~$\Nat$ for counting things. Theytalk about the $0$th, $1$st, $2$nd, and so on, !!{element}s of a list.Correspondingly, we can define an enumeration as !!a{surjective}function from $\Nat$ to~$A$. Of course, the two definitions areequivalent.\begin{prop}\ollabel{prop:enum-shift}There is !!a{surjection} $f\colon \PosInt \to A$ iff there is!!a{surjection} $g\colon \Nat \to A$.\end{prop}\begin{proof}Given !!a{surjection} $f\colon \PosInt \to A$, we can define $g(n) =f(n+1)$ for all $n \in \Nat$. It is easy to see that $g\colon \Nat\to A$ is !!{surjective}. Conversely, given !!a{surjection} $g\colon\Nat \to A$, define $f(n) = g(n-1)$.\end{proof}This gives us the following result:\begin{cor}\ollabel{cor:enum-nat}A set $A$ is !!{enumerable} iff it is empty or there is!!a{surjective} function $f\colon \Nat \to A$.\end{cor}We discussed above that a list of !!{element}s of a set~$A$ can beturned into a list without repetitions. This is also true forenumerations, but a bit harder to formulate and prove rigorously. Anyfunction $f\colon \PosInt \to A$ must be defined for all $n \in\PosInt$. If there are only finitely many !!{element}s in~$A$ then weclearly cannot have a function defined on the infinitely many!!{element}s of~$\PosInt$ that takes as values all the !!{element}sof~$A$ but never takes the same value twice. In that case, i.e., inthe case where the list without repetitions is finite, we must choosea different domain for~$f$, one with only finitely many !!{element}s.Not having repetitions means that $f$ must be !!{injective}. Since itis also !!{surjective}, we are looking for !!a{bijection} between somefinite set $\{1, \dots, n\}$ or $\PosInt$ and~$A$.\begin{prop}\ollabel{prop:enum-bij}If $f\colon \PosInt \to A$ is !!{surjective} (i.e., an enumerationof~$A$), there is !!a{bijection} $g\colon Z \to A$ where $Z$ iseither~$\PosInt$ or $\{1, \dots, n\}$ for some~$n \in \PosInt$.\end{prop}\begin{proof}We define the function $g$ recursively: Let $g(1) = f(1)$. If $g(i)$has already been defined, let $g(i+1)$ be the first value of $f(1)$,$f(2)$, \dots{} not already among $g(1)$, \dots, $g(i)$, if there isone. If $A$ has just $n$ !!{element}s, then $g(1)$, \dots, $g(n)$ are alldefined, and so we have defined a function $g\colon \{1, \dots, n\}\to A$. If $A$ has infinitely many !!{element}s, then for any $i$there must be !!a{element} of~$A$ in the enumeration $f(1)$, $f(2)$,\dots, which is not already among $g(1)$, \dots, $g(i)$. In thiscase we have defined a function $g\colon \PosInt \to A$.The function $g$ is !!{surjective}, since any element of~$A$ isamong $f(1)$, $f(2)$, \dots{} (since $f$ is !!{surjective}) and sowill eventually be a value of~$g(i)$ for some~$i$. It is also!!{injective}, since if there were $j < i$ such that $g(j) = g(i)$,then $g(i)$ would already be among $g(1)$, \dots, $g(i-1)$, contraryto how we defined~$g$.\end{proof}\begin{cor}\ollabel{cor:enum-nat-bij}A set $A$ is !!{enumerable} iff it is empty or there is !!a{bijection}$f\colon N \to A$ where either $N = \Nat$ or $N = \{0, \dots, n\}$ forsome $n \in \Nat$.\end{cor}\begin{proof}$A$ is !!{enumerable} iff $A$ is empty or there is !!a{surjective}$f\colon \PosInt \to A$. By \olref{prop:enum-bij}, the latter holdsiff there is !!a{bijective} function~$f\colon Z \to A$ where $Z =\PosInt$ or $Z = \{1, \dots, n\}$ for some $n \in \PosInt$. By thesame argument as in the proof of \olref{prop:enum-shift}, that in turnis the case iff there is !!a{bijection} $g\colon N \to A$ where either$N = \Nat$ or $N = \{0, \dots, n-1\}$.\end{proof}\begin{prob}According to \olref[sfr][siz][enm]{defn:enumerable}, a set $A$ isenumerable iff $A = \emptyset$ or there is !!a{surjective} $f\colon\PosInt \to A$. It is also possible to define ``!!{enumerable} set''precisely by: a set is enumerable iff there is !!a{injective}function $g\colon A \to \PosInt$. Show that the definitions areequivalent, i.e., show that there is !!a{injective} function$g\colon A \to \PosInt$ iff either $A = \emptyset$ or there is!!a{surjective} $f\colon \PosInt \to A$.\end{prob}\end{document}
content/sets-functions-relations/size-of-sets/equinumerous-sets.tex
111 lines; SHA-256 7b0444e3293b300b72b7a6d49638913a778f5131fd94650dd64a5f11040c91f2. Open the preserved source file.
% Part:sets-functions-relations% Chapter: size-of-sets% Section: equinumerous-sets\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\olfileid{sfr}{siz}{equ}\olsection{Equinumerosity}We have an intuitive notion of ``size'' of sets, which works fine forfinite sets. But what about infinite sets? If we want to come up witha formal way of comparing the sizes of two sets of \emph{any} size, itis a good idea to start by defining when sets are the same size. Hereis Frege:\begin{quote}If a waiter wants to be sure that he has laid exactly as many knivesas plates on the table, he does not need to count either of them, ifhe simply lays a knife to the right of each plate, so that everyknife on the table lies to the right of some plate. The plates andknives are thus uniquely correlated to each other, and indeedthrough that same spatial relationship. \citep[\S70]{Frege1884}\end{quote}The insight of this passage can be brought out through a formaldefinition:\begin{defn}\ollabel{comparisondef}$A$ is \emph{equinumerous} with $B$, written $\cardeq{A}{B}$, iffthere is !!a{bijection} $f \colon A \to B$.\end{defn}\begin{prop}\ollabel{equinumerosityisequi}Equinumerosity is an equivalence relation.\end{prop}\begin{proof}We must show that equinumerosity is reflexive, symmetric, andtransitive. Let $A, B$, and $C$ be sets.\emph{Reflexivity.} The identity map $\Id{A} \colon A \to A$, where$\Id{A} (x) = x$ for all $x \in A$, is !!a{bijection}. So$\cardeq{A}{A}$.\emph{Symmetry.} Suppose $\cardeq{A}{B}$, i.e., there is!!a{bijection} $f\colon A \to B$. Since $f$ is !!{bijective}, itsinverse $f^{-1}$ exists and is also !!{bijective}. Hence,$f^{-1}\colon B \to A$ is !!a{bijection}, so $\cardeq{B}{A}$.\emph{Transitivity.} Suppose that $\cardeq{A}{B}$ and $\cardeq{B}{C}$,i.e., there are !!{bijection}s $f\colon A \to B$ and $g\colon B \toC$. Then the composition $\comp{f}{g}\colon A \to C$ is !!{bijective},so that $\cardeq{A}{C}$.\end{proof}\begin{prop}If $\cardeq{A}{B}$, then $A$ is !!{enumerable} ifand only if $B$ is.\end{prop}\begin{editorial}The following proof uses \olref[enm]{defn:enumerable} if\olref[enm]{sec} is included and \olref[enm-alt]{defn:enumerable}otherwise.\end{editorial}\begin{proof}Suppose $\cardeq{A}{B}$, so there is some !!{bijection} $f \colon A\to B$, and suppose that $A$ is !!{enumerable}.\oliflabeldef{sfr:siz:enm:defn:enumerable}{Then either $A = \emptyset$ or there is !!a{surjective} function$g\colon \PosInt \to A$. If $A = \emptyset$, then $B = \emptyset$also (otherwise there would be !!a{element}~$y \in B$ but no $x \inA$ with $g(x) = y$). If, on the other hand, $g\colon \PosInt \to A$is !!{surjective}, then $\comp{g}{f} \colon \PosInt \to B$ is!!{surjective}. To see this, let $y \in B$. Since $f$ is!!{surjective}, there is an $x \in A$ such that $f(x) = y$. Since$g$ is !!{surjective}, there is an $n \in \PosInt$ such that $g(n) =x$. Hence,\[(\comp{g}{f})(n) = f(g(n)) = f(x) = y\]and thus $\comp{g}{f}$ is !!{surjective}. We have that $\comp{g}{f}$is an enumeration of~$B$, and so $B$~is !!{enumerable}.}{Then either $A = \emptyset$ or there is !!a{bijection}~$g$ whoserange is $A$ and whose domain is either $\Nat$ or an initialsequence of natural numbers. If $A = \emptyset$, then $B =\emptyset$ also (otherwise there would be some~$y \in B$ with no $x\in A$ such that $g(x) = y$). So suppose we have our!!{bijection}~$g$. Then $\comp{g}{f}$ is !!a{bijection} withrange~$B$ and domain the same as that of~$g$ (i.e., either $\Nat$ oran initial segment of it), so that $B$ is !!{enumerable}.}If $B$ is !!{enumerable}, we obtain that $A$ is !!{enumerable} byrepeating the argument with the !!{bijection} $f^{-1}\colon B \to A$instead of~$f$.\end{proof}\begin{prob}Show that if $\cardeq{A}{C}$ and $\cardeq{B}{D}$, and $A \cap B =C \cap D = \emptyset$, then $\cardeq{A \cup B}{C \cup D}$.\end{prob}\begin{prob}Show that if $A$ is infinite and !!{enumerable}, then$\cardeq{A}{\Nat}$.\end{prob}\end{document}
content/sets-functions-relations/size-of-sets/introduction.tex
28 lines; SHA-256 e771bd78d2b9819350b17f333524e22ce44a26647916f5b864cb934e380c1fb9. Open the preserved source file.
% Part:sets-functions-relations% Chapter: size-of-sets% Section: introduction\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\olfileid{sfr}{siz}{int}\olsection{Introduction}When Georg Cantor developed set theory in the 1870s, one of his aimswas to make palatable the idea of an infinite collection---an actualinfinity, as the medievals would say. A key part of this was histreatment of the \emph{size} of different sets. If $a$, $b$ and $c$ areall distinct, then the set $\{a, b, c\}$ is intuitively \emph{larger}than $\{a, b\}$. But what about infinite sets? Are they all as largeas each other? It turns out that they are not.The first important idea here is that of an enumeration. We canlist every finite set by listing all its !!{element}s. For someinfinite sets, we can also list all their !!{element}s if we allow thelist itself to be infinite. Such sets are called !!{enumerable}.Cantor's surprising result, which we will fully understand by the endof this chapter, was that some infinite sets are not !!{enumerable}.\end{document}
content/sets-functions-relations/size-of-sets/non-enumerability-alt.tex
162 lines; SHA-256 0c20a2c420fbf4dbd801bb97e37799b3c602ae33ef2b1dc85ff94e24208ca2bb. Open the preserved source file.
% Part:sets-functions-relations% Chapter: size-of-sets% Section: non-enumerability-alt\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\olfileid{sfr}{siz}{nen-alt}\olsection{\printtoken{S}{nonenumerable} Sets}\begin{editorial}This section proves the non-enumerability of $\Bin^\omega$ and$\Pow{\Nat}$ using the definitions in \olref[enm-alt]{sec}, i.e.,requiring a bijection with~$\Nat$ instead of a surjection from$\PosInt$.\end{editorial}\begin{explain}The set $\Nat$ of natural numbers is infinite. It is also trivially!!{enumerable}. But the remarkable fact is that there are\emph{!!{nonenumerable}} sets, i.e., sets which are not !!{enumerable}(see \olref[sfr][siz][enm-alt]{defn:enumerable}).This might be surprising. After all, to say that $A$ is!!{nonenumerable} is to say that there is \emph{no} !!{bijection} $f\colon \Nat \to A$; that is, no function mapping the infinitely many!!{element}s of~$\Nat$ to~$A$ exhausts all of~$A$. So if $A$ is!!{nonenumerable}, there are ``more'' !!{element}s of~$A$ than thereare natural numbers.To prove that a set is !!{nonenumerable}, you have to show that noappropriate !!{bijection} can exist. The best way to do this is toshow that every attempt to enumerate !!{element}s of~$A$ must leave atleast one !!{element} out; this shows that no function $f\colon \Nat\to A$ is !!{surjective}. And a general strategy for establishing thisis to use Cantor's \emph{diagonal method}. Given a list of!!{element}s of $A$, say, $x_1$, $x_2$, \dots, we construct another!!{element} of~$A$ which, by its construction, cannot possibly be onthat list.But all of this is best understood by example. So, our first exampleis the set~$\Bin^\omega$ of all infinite strings of $0$'s and $1$'s.(The `$\Bin$' stands for binary, and we can just think of it as thetwo-element set$\{0,1\}$.)\oliflabeldef{sfr:card-arithmetic:card-opps:sec}{\footnote{Moreaccurately, we should stipulate that $\Bin^\omega$ is the set of all$\omega$-sequences of $0$'s and $1$s, i.e., the set$\funfromto{\omega}{\{0,1\}}$. But the meaning of this will onlybecome clear in \olref[sfr][card-arithmetic][card-opps]{sec}.}{} Thisslightly loose formulation should not cause any confusionsfor now, however.}\end{explain}\begin{thm}\ollabel{thm:nonenum-bin-omega}$\Bin^\omega$~is !!{nonenumerable}.\end{thm}\begin{proof}Consider any enumeration of a subset of $\Bin^\omega$. So we have somelist $s_{0}$, $s_{1}$, $s_{2}$, \dots{} where every $s_n$ is aninfinite string of $0$'s and~$1$'s. Let $s_n(m)$ be the $n$th digit ofthe $m$th string in this list. So we can now think of our list as anarray, where $s_n(m)$ is placed at the $n$th row and $m$th column:\[\begin{array}{c|c|c|c|c|c}& 0 & 1 & 2 & 3 & \dots \\\hline0 & \mathbf{s_{0}(0)} & s_{0}(1) & s_{0}(2) & s_0(3) & \dots \\\hline1 & s_{1}(0)& \mathbf{s_{1}(1)} & s_1(2) & s_1(3) & \dots \\\hline2 & s_{2}(0)& s_{2}(1) & \mathbf{s_2(2)} & s_2(3) & \dots \\\hline3 & s_{3}(0)& s_{3}(1) & s_3(2) & \mathbf{s_3(3)} & \dots \\\hline\vdots & \vdots & \vdots & \vdots & \vdots & \mathbf{\ddots}\end{array}\]We will now construct an infinite string, $d$, of $0$'s and $1$'swhich is not on this list. We will do this by specifying each of itsentries, i.e., we specify $d(n)$ for all $n \in \Nat$. Intuitively,we do this by reading down the diagonal of the array above (hence thename ``diagonal method'') and then changing every $1$ to a $0$ andevery $1$ to a~$0$. More abstractly, we define $d(n)$ to be $0$ or $1$according to whether the $n$-th !!{element} of the diagonal, $s_n(n)$,is $1$ or $0$, that is:\[d(n) =\begin{cases}1 & \text{if $s_{n}(n) = 0$}\\0 & \text{if $s_{n}(n) = 1$}\end{cases}\]Clearly $d \in \Bin^\omega$, since it is an infinite string of $0$'sand $1$'s. But we have constructed $d$ so that $d(n) \neq s_n(n)$ forany $n \in \Nat$. That is, $d$ differs from $s_n$ in its $n$th entry.So $d \neq s_n$ for any $n\in \Nat$. So $d$ cannot be on the list$s_0$, $s_1$, $s_2$,\dotsWe have shown, given an arbitrary enumeration of some subset of$\Bin^\omega$, that it will omit some !!{element} of $\Bin^\omega$. Sothere is no enumeration of the set $\Bin^\omega$, i.e., $\Bin^\omega$is !!{nonenumerable}.\end{proof}\begin{explain}This proof method is called ``diagonalization'' because it uses thediagonal of the array to define~$d$. However, diagonalization neednot involve the presence of an array. Indeed, we can show that some set is!!{nonenumerable} by using a similar idea, even when no array and noactual diagonal is involved. The following result illustrates how.\end{explain}\begin{thm}\ollabel{thm:nonenum-pownat}$\Pow{\Nat}$ is not !!{enumerable}.\end{thm}\begin{proof}We proceed in the same way, by showing that every list of subsetsof~$\Nat$ omits some subset of $\Nat$. So, suppose that we have somelist $N_0, N_1, N_2, \ldots$ of subsets of $\Nat$. We define a set $D$as follows: $n \in D$ iff $n \notin N_{n}$:\[D = \Setabs{n \in \Nat}{n \notin N_n}\]Clearly $D\subseteq \Nat$. But $D$ cannot be on the list. After all,by construction $n \in D$ iff $n\notin N_n$, so that $D \neq N_n$ forany $n \in \Nat$.\end{proof}\begin{explain}The preceding proof did not mention a diagonal. Still, you can thinkof it as involving a diagonal if you picture it this way: Imagine thesets $N_0$, $N_1$, \dots, written in an array, where we write $N_n$ onthe $n$th row by writing $m$ in the $m$th column iff if $m \in N_n$.For example, say the first four sets on that list are$\{0,1,2,\dots\}$, $\{1, 3, 5, \dots\}$, $\{0,1,4\}$, and$\{2,3,4,\dots\}$; then our array would begin with\[\begin{array}{r@{}rrrrrrr}N_0 = \{ & \mathbf{0}, & 1, & 2, & & & & \dots\}\\N_1 = \{ & & \mathbf{1}, & & 3, & & 5, & \dots\}\\N_2 = \{ & 0, & 1, & & & 4\phantom{,} & & \}\\N_3 = \{ & & & 2, & \mathbf{3}, & 4, & & \dots\}\\&\vdots & & & & & & \ddots\phantom{\}}\end{array}\]Then $D$ is the set obtained by going down the diagonal, placing $n\in D$ iff $n$ is \emph{not} on the diagonal. So in the above case, wewould leave out $0$ and $1$, we would include~$2$, we would leaveout~$3$, etc.\end{explain}\begin{prob}Show that the set of all functions $f \colon \Nat \to \Nat$ is!!{nonenumerable} by an explicit diagonal argument. That is, show thatif $f_1$, $f_2$, \dots, is a list of functions and each $f_i\colon\Nat \to \Nat$, then there is some $g \colon \Nat \to\Nat$ not on this list.\end{prob}\end{document}
content/sets-functions-relations/size-of-sets/non-enumerability.tex
214 lines; SHA-256 a272a841f8c50bda6589aac40278b9bff7f8a1f5284730c7195423b09ac3ba2e. Open the preserved source file.
% Part:sets-functions-relations% Chapter: size-of-sets% Section: non-enumerability\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\olfileid{sfr}{siz}{nen}\olsection{\printtoken{S}{nonenumerable} Sets}\begin{editorial}This section proves the non-enumerability of $\Bin^\omega$ and$\Pow{\PosInt}$ using the definition in \olref[enm]{sec}. It isdesigned to be a little more elementary and a little more detailedthan the version in \olref[enm-alt]{sec}\end{editorial}Some sets, such as the set $\PosInt$ of positive integers, areinfinite. So far we've seen examples of infinite sets which were all!!{enumerable}. However, there are also infinite sets which do nothave this property. Such sets are called \emph{!!{nonenumerable}}.First of all, it is perhaps already surprising that there are!!{nonenumerable} sets. For any !!{enumerable} set~$A$ there is!!a{surjective} function $f \colon \PosInt \to A$. If a set is!!{nonenumerable} there is no such function. That is, no functionmapping the infinitely many !!{element}s of~$\PosInt$ to~$A$ canexhaust all of~$A$. So there are ``more'' !!{element}s of~$A$ thanthe infinitely many positive integers.How would one prove that a set is !!{nonenumerable}? You have to showthat no such surjective function can exist. Equivalently, you have toshow that the elements of~$A$ cannot be enumerated in a one wayinfinite list. The best way to do this is to show that every list of!!{element}s of~$A$ must leave at least one element out; or that nofunction $f\colon \PosInt \to A$ can be !!{surjective}. We can do thisusing Cantor's \emph{diagonal method}. Given a list of !!{element}sof~$A$, say, $x_1$, $x_2$, \dots, we construct another element of~$A$which, by its construction, cannot possibly be on that list.Our first example is the set~$\Bin^\omega$ of all infinite, non-gappysequences of $0$'s and $1$'s.\begin{thm}\ollabel{thm:nonenum-bin-omega}$\Bin^\omega$~is !!{nonenumerable}.\end{thm}\begin{proof}Suppose, by way of contradiction, that $\Bin^\omega$ is!!{enumerable}, i.e., suppose that there is a list $s_{1}$, $s_{2}$,$s_{3}$, $s_{4}$, \dots{} of all !!{element}s of~$\Bin^\omega$. Eachof these $s_i$ is itself an infinite sequence of $0$'s and~$1$'s.Let's call the $j$-th element of the $i$-th sequence in this list$s_i(j)$. Then the $i$-th sequence~$s_i$ is\[s_i(1), s_i(2), s_i(3), \dots\]We may arrange this list, and the elements of each sequence $s_i$ init, in an array:\[\begin{array}{c|c|c|c|c|c}& 1 & 2 & 3 & 4 & \dots \\\hline1 & \mathbf{s_{1}(1)} & s_{1}(2) & s_{1}(3) & s_1(4) & \dots \\\hline2 & s_{2}(1)& \mathbf{s_{2}(2)} & s_2(3) & s_2(4) & \dots \\\hline3 & s_{3}(1)& s_{3}(2) & \mathbf{s_3(3)} & s_3(4) & \dots \\\hline4 & s_{4}(1)& s_{4}(2) & s_4(3) & \mathbf{s_4(4)} & \dots \\\hline\vdots & \vdots & \vdots & \vdots & \vdots & \mathbf{\ddots}\end{array}\]The labels down the side give the number of the sequence in the list$s_1$, $s_2$, \dots; the numbers across the top label the !!{element}sof the individual sequences. For instance, $s_{1}(1)$ is a name forwhatever number, a $0$ or a~$1$, is the first !!{element} in thesequence $s_{1}$, and so on.Now we construct an infinite sequence, $\overline{s}$, of $0$'s and$1$'s which cannot possibly be on this list. The definition of$\overline{s}$ will depend on the list $s_1$, $s_2$, \dots. Anyinfinite list of infinite sequences of $0$'s and $1$'s gives rise toan infinite sequence~$\overline{s}$ which is guaranteed to not appearon the list.To define $\overline{s}$, we specify what all its !!{element}s are,i.e., we specify $\overline{s}(n)$ for all $n \in \PosInt$. We do thisby reading down the diagonal of the array above (hence the name``diagonal method'') and then changing every $1$ to a $0$ and every$0$ to a~$1$. More abstractly, we define $\overline{s}(n)$ to be $0$or $1$ according to whether the $n$-th !!{element} of the diagonal,$s_n(n)$, is $1$ or $0$.\[\overline{s}(n) =\begin{cases}1 & \text{if $s_{n}(n) = 0$}\\0 & \text{if $s_{n}(n) = 1$}.\end{cases}\]If you like formulas better than definitions by cases, you could alsodefine $\overline{s}(n) = 1 - s_n(n)$.Clearly $\overline{s}$ is an infinite sequence of $0$'s and$1$'s, since it is just the mirror sequence to the sequence of $0$'sand $1$'s that appear on the diagonal of our array. So $\overline{s}$is !!a{element} of~$\Bin^\omega$. But it cannot be on the list $s_1$,$s_2$, \dots{} Why not?It can't be the first sequence in the list, $s_1$, because it differs from$s_1$ in the first !!{element}. Whatever $s_1(1)$ is, we defined$\overline{s}(1)$ to be the opposite. It can't be the secondsequence in the list, because $\overline{s}$ differs from $s_2$ in the secondelement: if $s_2(2)$ is $0$, $\overline{s}(2)$ is $1$, and viceversa. And so on.More precisely: if $\overline{s}$ were on the list, there would besome $k$ so that $\overline{s} = s_{k}$. Two sequences are identicaliff they agree at every place, i.e., for any~$n$, $\overline{s}(n) =s_{k}(n)$. So in particular, taking $n = k$ as a special case,$\overline{s}(k) = s_{k}(k)$ would have to hold. $s_k(k)$ is either$0$ or~$1$. If it is $0$ then $\overline{s}(k)$ must be~$1$---that'show we defined $\overline{s}$. But if $s_k(k) = 1$ then, again becauseof the way we defined $\overline{s}$, $\overline{s}(k) = 0$. In eithercase $\overline{s}(k) \neq s_{k}(k)$.We started by assuming that there is a list of !!{element}s of$\Bin^\omega$, $s_1$, $s_2$, \dots{} From this list we constructed asequence~$\overline{s}$ which we proved cannot be on the list. But itdefinitely is a sequence of $0$'s and $1$'s if all the $s_i$ aresequences of $0$'s and $1$'s, i.e., $\overline{s} \in\Bin^\omega$. This shows in particular that there can be no list of\emph{all} !!{element}s of~$\Bin^\omega$, since for any such list wecould also construct a sequence~$\overline{s}$ guaranteed to not be onthe list, so the assumption that there is a list of all sequencesin~$\Bin^\omega$ leads to a contradiction.\end{proof}\begin{explain}This proof method is called ``diagonalization'' because it uses thediagonal of the array to define~$\overline{s}$. Diagonalization neednot involve the presence of an array: we can show that sets are not!!{enumerable} by using a similar idea even when no array and noactual diagonal is involved.\end{explain}\begin{thm}\ollabel{thm:nonenum-pownat}$\Pow{\PosInt}$ is not !!{enumerable}.\end{thm}\begin{proof}We proceed in the same way, by showing that for every list of subsetsof~$\PosInt$ there is a subset of $\PosInt$ which cannot be on the list.Suppose the following is a given list of subsets of~$\PosInt$:\[Z_{1}, Z_{2}, Z_{3}, \dots\]We now define a set $\overline{Z}$ such that for any $n \in \PosInt$,$n \in \overline{Z}$ iff $n \notin Z_{n}$:\[\overline{Z} = \Setabs{n \in \PosInt}{n \notin Z_n}\]$\overline{Z}$ is clearly a set of positive integers, since byassumption each~$Z_n$ is, and thus $\overline{Z} \in\Pow{\PosInt}$. But $\overline{Z}$ cannot be on the list. To showthis, we'll establish that for each $k \in \PosInt$, $\overline{Z} \neqZ_k$.So let $k \in \PosInt$ be arbitrary. We've defined $\overline{Z}$ sothat for any $n \in \PosInt$, $n \in \overline{Z}$ iff $n \notin Z_n$.In particular, taking $n=k$, $k \in \overline{Z}$ iff $k \notin Z_k$.But this shows that $\overline{Z} \neq Z_k$, since $k$ is !!a{element}of one but not the other, and so $\overline{Z}$ and $Z_k$ havedifferent !!{element}s. Since $k$ was arbitrary, $\overline{Z}$ is noton the list $Z_1$, $Z_2$, \dots\end{proof}\begin{explain}The preceding proof did not mention a diagonal, but you can think ofit as involving a diagonal if you picture it this way: Imagine thesets $Z_1$, $Z_2$, \dots, written in an array, where each!!{element}~$j \in Z_i$ is listed in the~$j$-th column. Say the firstfour sets on that list are $\{1,2,3,\dots\}$, $\{2, 4, 6, \dots\}$,$\{1,2,5\}$, and $\{3,4,5,\dots\}$. Then the array would begin with\[\begin{array}{r@{}rrrrrrr}Z_1 = \{ & \mathbf{1}, & 2, & 3, & 4, & 5, & 6, & \dots\}\\Z_2 = \{ & & \mathbf{2}, & & 4, & & 6, & \dots\}\\Z_3 = \{ & 1, & 2, & & & 5\phantom{,} & & \}\\Z_4 = \{ & & & 3, & \mathbf{4}, & 5, & 6, & \dots\}\\\vdots & & & & & \ddots\end{array}\]Then $\overline{Z}$ is the set obtained by going down the diagonal,leaving out any numbers that appear along the diagonal and includethose $j$ where the array has a gap in the $j$-th row/column. In theabove case, we would leave out $1$ and $2$, include~$3$, leaveout~$4$, etc.\end{explain}\begin{prob}Show that $\Pow{\Nat}$ is !!{nonenumerable} by a diagonal argument.\end{prob}\begin{prob}\label{sfr:siz:nen:prob:f-posint}Show that the set of functions $f \colon \PosInt \to \PosInt$ is!!{nonenumerable} by an explicit diagonal argument. That is, show thatif $f_1$, $f_2$, \dots, is a list of functions and each $f_i\colon\PosInt \to \PosInt$, then there is some $\overline{f}\colon \PosInt \to\PosInt$ not on this list.\end{prob}\end{document}
content/sets-functions-relations/size-of-sets/pairing-alt.tex
114 lines; SHA-256 fd523f5306e1fd0e5c03f4c572d244fb017d1c0be27939f180bc6867a214e425. Open the preserved source file.
% Part:sets-functions-relations% Chapter: size-of-sets% Section: pairing-alt\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\olfileid{sfr}{siz}{pai-alt}\olsection{An Alternative Pairing Function}\begin{explain}There are other enumerations of $\Nat^2$ that make it easier tofigure out what their inverses are. Here is one. Instead ofvisualizing the enumeration in an array, start with the list ofpositive integers associated with (initially) empty spaces. Imaginefilling these spaces successively with pairs $\tuple{n,m}$ as follows.Starting with the pairs that have~$0$ in the first place (i.e., pairs$\tuple{0,m}$), put the first (i.e., $\tuple{0,0}$) in the first emptyplace, then skip an empty space, put the second (i.e., $\tuple{0,2}$)in the next empty place, skip one again, and so forth. The(incomplete) beginning of our enumeration now looks like this\[\small\begin{array}{@{}c c c c c c c c c c c@{}}\mathbf 1 & \mathbf 2 & \mathbf 3 & \mathbf 4 & \mathbf 5 & \mathbf 6 & \mathbf 7 & \mathbf 8 & \mathbf 9 & \mathbf{10} & \dots \\ \\\tuple{0,0} & & \tuple{0,1} & & \tuple{0,2} & & \tuple{0,3} & & \tuple{0,4} & & \dots \\\end{array}\]Repeat this with pairs $\tuple{1,m}$ for the place that still remainempty, again skipping every other empty place:\[\small\begin{array}{@{}c c c c c c c c c c c@{}}\mathbf 1 & \mathbf 2 & \mathbf 3 & \mathbf 4 & \mathbf 5 & \mathbf 6 & \mathbf 7 & \mathbf 8 & \mathbf 9 & \mathbf{10} & \dots \\ \\\tuple{0,0} & \tuple{1,0} & \tuple{0,1} & & \tuple{0,2} & \tuple{1,1} &\tuple{0,3} & & \tuple{0,4} & \tuple{1,2} & \dots \\\end{array}\]Enter pairs $\tuple{2,m}$, $\tuple{2,m}$, etc., in the same way. Ourcompleted enumeration thus starts like this:\[\small\begin{array}{@{}cc c c c c c c c c c@{}}\mathbf 1 & \mathbf 2 & \mathbf 3 & \mathbf 4 & \mathbf 5 & \mathbf 6 & \mathbf 7 & \mathbf 8 & \mathbf 9 & \mathbf{10} & \dots \\ \\\tuple{0,0} & \tuple{1,0} & \tuple{0,1} & \tuple{2,0} & \tuple{0,2} &\tuple{1,1} & \tuple{0,3} & \tuple{3,0} & \tuple{0,4} & \tuple{1,2} & \dots \\\end{array}\]If we number the cells in the array above according to thisenumeration, we will not find a neat zig-zag line, but thisarrangement:\[\begin{array}{ c | c | c | c | c | c | c | c }& \mathbf 0 & \mathbf 1 & \mathbf 2 & \mathbf 3 & \mathbf 4 & \mathbf 5 & \dots \\\hline\mathbf 0 & 1 & 3 & 5 & 7 & 9 & 11 & \dots \\\hline\mathbf 1 & 2 & 6 & 10 & 14 & 18 & \dots & \dots \\\hline\mathbf 2 & 4 & 12 & 20 & 28 & \dots & \dots & \dots \\\hline\mathbf 3 & 8 & 24 & 40 & \dots & \dots & \dots & \dots \\\hline\mathbf 4 & 16 & 48 & \dots & \dots & \dots & \dots & \dots \\\hline\mathbf 5 & 32 & \dots & \dots & \dots & \dots & \dots & \dots \\\hline\vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \ddots\\\end{array}\]We can see that the pairs in row~$0$ are in the odd numbered places ofour enumeration, i.e., pair $\tuple{0,m}$ is in place $2m+1$; pairs inthe second row, $\tuple{1,m}$, are in places whose number is thedouble of an odd number, specifically, $2 \cdot (2m+1)$; pairs in thethird row, $\tuple{2,m}$, are in places whose number is four times anodd number, $4 \cdot (2m+1)$; and so on. The factors of $(2m+1)$ foreach row, $1$, $2$, $4$, $8$, \dots, are exactly the powers of~$2$:$1= 2^0$, $2 = 2^1$, $4 = 2^2$, $8 = 2^3$, \dots\@ In fact, therelevant exponent is always the first member of the pair inquestion. Thus, for pair $\tuple{n,m}$ the factor is $2^n$. Thisgives us the general formula: $2^n \cdot (2m+1)$. However, this is amapping of pairs to \emph{positive} integers, i.e., $\tuple{0,0}$ hasposition~$1$. If we want to begin at position~$0$ we must subtract~$1$from the result. This gives us:\end{explain}\begin{ex}The function $h\colon \Nat^2 \to \Nat$ given by\[h(n,m) = 2^n (2m+1) - 1\]is a pairing function for the set of pairs of natural numbers~$\Nat^2$.\end{ex}\begin{explain}Accordingly, in our second enumeration of $\Nat^2$, the pair$\tuple{0,0}$ has code $h(0,0) = 2^0(2\cdot 0+1) - 1 = 0$;$\tuple{1,2}$ has code $2^{1} \cdot (2 \cdot 2 + 1) - 1 = 2\cdot 5 - 1 = 9$; $\tuple{2,6}$ has code $2^{2} \cdot (2\cdot 6 + 1) - 1 = 51$.\end{explain}Sometimes it is enough to encode pairs of natural numbers~$\Nat^2$without requiring that the encoding is surjective. Such encodings haveinverses that are only partial functions.\begin{ex}The function $j\colon \Nat^2 \to \Nat^+$ given by\[j(n,m) = 2^n3^m\]is !!a{injective} function $\Nat^2 \to \Nat$.\end{ex}\end{document}
content/sets-functions-relations/size-of-sets/pairing.tex
115 lines; SHA-256 345a39184e28af727e378d5b5883b5e7d2e1c27cd729329376d19426ddaed484. Open the preserved source file.
% Part:sets-functions-relations% Chapter: size-of-sets% Section: pairing\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\olfileid{sfr}{siz}{pai}\olsection{Pairing Functions and Codes}\begin{explain}Cantor's zig-zag method makes the enumerability of $\Nat^n$ visuallyevident. But let us focus on our array depicting $\Nat^2$. Followingthe zig-zag line in the array and counting the places, we can checkthat $\tuple{1,2}$ is associated with the number~$7$. However, it wouldbe nice if we could compute this more directly. That is, it would benice to have to hand the \emph{inverse} of the zig-zag enumeration,$g\colon \Nat^2 \to \Nat$, such that\[g(\tuple{0,0}) = 0, \;g(\tuple{0,1}) = 1, \;g(\tuple{1,0}) = 2, \; \dots,g(\tuple{1,2}) = 7, \; \dots\]This would enable us to calculate exactly where $\tuple{n, m}$ will occurin our enumeration.In fact, we can define $g$ directly by making two observations. First:if the $n$th row and $m$th column contains value~$v$, then the$(n+1)$st row and $(m-1)$st column contains value $v + 1$. Second: thefirst row of our enumeration consists of the triangular numbers,starting with $0$, $1$, $3$, $6$, etc. The $k$th triangular number isthe sum of the natural numbers $< k$, which can be computed as$k(k+1)/2$. Putting these two observations together, consider thisfunction:\[g(n,m) = \frac{(n+m+1)(n+m)}{2} + n\]We often just write $g(n, m)$ rather that $g(\tuple{n, m})$, since itis easier on the eyes. This tells you first to determine the$(n+m)^\text{th}$ triangle number, and then add $n$ to it. Andit populates the array in exactly the way we would like. So inparticular, the pair $\tuple{1, 2}$ is sent to $\frac{4 \times 3}{2} +1 = 7$.This function $g$ is the \emph{inverse} of an enumeration of a set ofpairs. Such functions are called \emph{pairing functions}.\end{explain}\begin{defn}[Pairing function]A function $f\colon A \times B \to \Nat$ is an arithmetical\emph{pairing function} if $f$ is injective. We also say that $f$\emph{encodes} $A \times B$, and that $f(x,y)$ is the\emph{code} for $\tuple{x,y}$.\end{defn}\begin{explain}We can use pairing functions to encode, e.g., pairs of natural numbers;or, in other words, we can represent each \emph{pair} of elementsusing a \emph{single} number. Using the inverse of the pairingfunction, we can \emph{decode} the number, i.e., find out whichpair it represents.\end{explain}\begin{prob}Give an enumeration of the set of all non-negative rational numbers.\end{prob}\begin{prob}Show that $\Rat$ is !!{enumerable}. Recall that any rational numbercan be written as a fraction $z/m$ with $z \in \Int$, $m \in \Nat^+$.\end{prob}\begin{prob}Define an enumeration of $\Bin^*$.\end{prob}\begin{prob}Recall from your introductory logic course that each possible truthtable expresses a truth function. In other words, the truth functionsare all functions from $\Bin^k \to \Bin$ for some~$k$. Prove that theset of all truth functions is enumerable.\end{prob}\begin{prob}Show that the set of all finite subsets of an arbitrary infinite!!{enumerable} set is !!{enumerable}.\end{prob}\begin{prob}A subset of $\Nat$ is said to be \emph{cofinite} iff it is thecomplement of a finite set $\Nat$; that is, $A \subseteq \Nat$ iscofinite iff $\Nat\setminus A$ is finite. Let $I$ be the set whose!!{element}s are exactly the finite and cofinite subsets of $\Nat$.Show that $I$ is !!{enumerable}.\end{prob}\begin{prob}Show that the !!{enumerable} union of !!{enumerable} sets is!!{enumerable}. That is, whenever $A_1$, $A_2$, \dots{} are sets, andeach $A_i$ is !!{enumerable}, then the union $\bigcup_{i=1}^\inftyA_i$ of all of them is also !!{enumerable}. [NB: this is hard!]\end{prob}\begin{prob}Let $f \colon A \times B \to \Nat$ be an arbitrary pairing function.Show that the inverse of $f$ is an enumeration of $A \times B$.\end{prob}\begin{prob}Specify a function that encodes $\Nat^3$.\end{prob}\end{document}
content/sets-functions-relations/size-of-sets/reduction-alt.tex
140 lines; SHA-256 46381b85c0e9a1ab48cb9301518de91f073d649c3b1119325c1409f5a6c1d663. Open the preserved source file.
% Part:sets-functions-relations% Chapter: size-of-sets% Section: reduction-alt\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\olfileid{sfr}{siz}{red-alt}\olsection{Reduction}\begin{editorial}This section proves non-enumerability by reduction, matching theresults in \olref[nen-alt]{sec}. An alternative, slightly moreelaborate version matching the results in \olref[nen]{sec} isprovided in \olref[red]{sec}.\end{editorial}We proved that $\Bin^\omega$ is !!{nonenumerable} by a diagonalizationargument. We used a similar diagonalization argument to show that$\Pow{\Nat}$ is !!{nonenumerable}. But here's another way we can provethat $\Pow{\Nat}$ is !!{nonenumerable}: show that \emph{if$\Pow{\Nat}$ is !!{enumerable} then $\Bin^\omega$ is also!!{enumerable}}. Since we know $\Bin^\omega$ is !!{nonenumerable}, itwill follow that $\Pow{\Nat}$ is too.This is called \emph{reducing} one problem to another. In this case,we reduce the problem of enumerating $\Bin^\omega$ to the problem ofenumerating $\Pow{\Nat}$. A solution to the latter---an enumerationof $\Pow{\Nat}$---would yield a solution to the former---anenumeration of $\Bin^\omega$.To reduce the problem of enumerating a set~$B$ to that of enumeratinga set~$A$, we provide a way of turning an enumeration of~$A$ into anenumeration of~$B$. The easiest way to do that is to define!!a{surjection} $f\colon A \to B$. If $x_1$, $x_2$, \dots{}enumerates~$A$, then $f(x_1)$, $f(x_2)$, \dots{} would enumerate~$B$.In our case, we are looking for !!a{surjection} $f\colon \Pow{\Nat}\to \Bin^\omega$.\begin{prob}Show that if there is an !!{injective} function $g\colon B \to A$, and$B$~is !!{nonenumerable}, then so is~$A$. Do this by showing how youcan use~$g$ to turn an enumeration of~$A$ into one of~$B$.\end{prob}\begin{proof}[Proof of {\olref[nen-alt]{thm:nonenum-pownat}} by reduction]For a reduction, suppose that $\Pow{\Nat}$ is !!{enumerable}, and thus thatthere is an enumeration of it, $N_{1}$, $N_{2}$, $N_{3}$, \dotsDefine the function $f \colon \Pow{\Nat} \to \Bin^\omega$ by letting$f(N)$ be the string $s_{k}$ such that $s_{k}(n) = 1$ iff $n \in N$,and $s_k(n) = 0$ otherwise.This clearly defines a function, since whenever $N \subseteq \Nat$,any $n \in \Nat$ either is !!a{element} of $N$ or isn't. Forinstance, the set $2\Nat = \Setabs{2n}{n \in \Nat} = \{0,2, 4, 6,\dots\}$ of even naturals gets mapped to the string $1010101\dots$;$\emptyset$ gets mapped to $0000\dots$; $\Nat$ gets mapped to$1111\dots$.It is also !!{surjective}: every string of $0$s and $1$s correspondsto some set of natural numbers, namely the one which has as itsmembers those natural numbers corresponding to the places where the stringcontains a~$1$s. More precisely, if $s \in \Bin^\omega$, then define $N\subseteq \Nat$ by:\[N = \Setabs{n \in \Nat}{s(n) = 1}\]Then $f(N) = s$, as can be verified by consulting the definitionof~$f$.Now consider the list\[f(N_1), f(N_2), f(N_3), \dots\]Since $f$ is !!{surjective}, every member of $\Bin^\omega$ mustappear as a value of~$f$ for some argument, and so must appear on thelist. This list must therefore enumerate all of~$\Bin^\omega$.So if $\Pow{\Nat}$ were !!{enumerable}, $\Bin^\omega$ would be!!{enumerable}. But $\Bin^\omega$ is !!{nonenumerable}(\olref[nen-alt]{thm:nonenum-bin-omega}). Hence $\Pow{\Nat}$ is!!{nonenumerable}.\end{proof}%\begin{explain}%It is easy to be confused about the direction the reduction goes in.%For instance, !!a{surjective} function $g \colon \Bin^\omega \to X$%does \emph{not} establish that $X$ is !!{nonenumerable}. (Consider $g%\colon \Bin^\omega \to \Bin$ defined by $g(s) = s(1)$, the function%that maps a sequence of $0$'s and $1$'s to its first !!{element}. It%is surjective, because some sequences start with $0$ and some start%with $1$. But $\Bin$ is finite.) Note also that the function $f$ must%be surjective, or otherwise the argument does not go through:%$f(x_1)$, $f(x_2)$, \dots{} would then not be guaranteed to include%all the !!{element}s of~$Y$. For instance, $h\colon \Nat \to%\Bin^\omega$ defined by%\[%h(n) = \underbrace{000\dots0}_{\text{$n$ $0$'s}}%\]%is a function, but $\Nat$ is !!{enumerable}.%\end{explain}\begin{prob}\label{sfr:siz:red:prob:nat-nat}Show that the set~$X$ of all functions $f\colon \Nat \to \Nat$ is!!{nonenumerable} by a reduction argument (Hint: give a surjectivefunction from $X$ to~$\Bin^\omega$.)\end{prob}\begin{prob}Show that the set of all \emph{sets of} pairs of natural numbers,i.e., $\Pow{\Nat \times \Nat}$, is !!{nonenumerable} by a reductionargument.\end{prob}\begin{prob}Show that $\Nat^\omega$, the set of infinite sequences of naturalnumbers, is !!{nonenumerable} by a reduction argument.\end{prob}%\begin{prob}%Let $P$ be the set of functions from $\Nat$ to the set $\{0\}$, and let $Q$ be the set of \emph{partial}%functions from the set of positive integers to the set $\{0\}$. Show%that $P$~is !!{enumerable} and $Q$~is not. (Hint: reduce the problem%of enumerating $\Bin^\omega$ to enumerating~$Q$).%\end{prob}\begin{prob}Let $S$ be the set of all !!{surjection}s from $\Nat$ to the set$\{0,1\}$, i.e., $S$ consists of all !!{surjection}s~$f \colon \Nat\to \Bin$. Show that $S$ is !!{nonenumerable}.\end{prob}\begin{prob}Show that the set~$\Real$ of all real numbers is !!{nonenumerable}.\end{prob}\end{document}
content/sets-functions-relations/size-of-sets/reduction.tex
138 lines; SHA-256 33f0cbb35c8c1fa3ff0e4f44fa626fdc298d1c4612aeaafb41bcb920e5d18ac8. Open the preserved source file.
% Part:sets-functions-relations% Chapter: sets% Section: reduction\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\olfileid{sfr}{siz}{red}\olsection{Reduction}\begin{editorial}This section proves non-enumerability by reduction, matching theresults in \olref[nen]{sec}. An alternative, slightly more condensedversion matching the results in \olref[nen-alt]{sec} is provided in\olref[red-alt]{sec}.\end{editorial}We showed $\Pow{\PosInt}$ to be !!{nonenumerable} by a diagonalizationargument. We already had a proof that $\Bin^\omega$, the set of allinfinite sequences of $0$s and $1$s, is !!{nonenumerable}. Here'sanother way we can prove that $\Pow{\PosInt}$ is !!{nonenumerable}:Show that \emph{if $\Pow{\PosInt}$ is !!{enumerable} then $\Bin^\omega$is also !!{enumerable}}. Since we know $\Bin^\omega$ is not!!{enumerable}, $\Pow{\PosInt}$ can't be either. This is called\emph{reducing} one problem to another---in this case, we reduce theproblem of enumerating $\Bin^\omega$ to the problem of enumerating$\Pow{\PosInt}$. A solution to the latter---an enumeration of$\Pow{\PosInt}$---would yield a solution to the former---an enumerationof $\Bin^\omega$.How do we reduce the problem of enumerating a set~$B$ to that ofenumerating a set~$A$? We provide a way of turning an enumerationof~$A$ into an enumeration of~$B$. The easiest way to do that is todefine !!a{surjective} function $f\colon A \to B$. If $x_1$, $x_2$,\dots{} enumerates~$A$, then $f(x_1)$, $f(x_2)$, \dots{} wouldenumerate~$B$. In our case, we are looking for a surjectivefunction $f\colon \Pow{\PosInt} \to \Bin^\omega$.\begin{prob}Show that if there is an !!{injective} function $g\colon B \to A$, and$B$~is !!{nonenumerable}, then so is~$A$. Do this by showing how youcan use~$g$ to turn an enumeration of~$A$ into one of~$B$.\end{prob}\begin{proof}[Proof of {\olref[nen]{thm:nonenum-pownat}} by reduction]Suppose that $\Pow{\PosInt}$ were !!{enumerable}, and thus thatthere is an enumeration of it, $Z_{1}$, $Z_{2}$, $Z_{3}$, \dotsDefine the function $f \colon \Pow{\PosInt} \to \Bin^\omega$ by letting$f(Z)$ be the sequence $s_{k}$ such that $s_{k}(n) = 1$ iff $n \in Z$,and $s_k(n) = 0$ otherwise. This clearly defines a function, sincewhenever $Z \subseteq \PosInt$, any $n \in \PosInt$ either is!!a{element} of $Z$ or isn't. For instance, the set $2\PosInt = \{2,4, 6, \dots\}$ of positive even numbers gets mapped to the sequence$010101\dots$, the empty set gets mapped to $0000\dots$ and the set$\PosInt$ itself to $1111\dots$.It also is !!{surjective}: Every sequence of $0$s and $1$s correspondsto some set of positive integers, namely the one which has as itsmembers those integers corresponding to the places where the sequencehas~$1$s. More precisely, suppose $s \in \Bin^\omega$. Define $Z\subseteq \PosInt$ by:\[Z = \Setabs{n \in \PosInt}{s(n) = 1}\]Then $f(Z) = s$, as can be verified by consulting the definitionof~$f$.Now consider the list\[f(Z_1), f(Z_2), f(Z_3), \dots\]Since $f$ is !!{surjective}, every member of $\Bin^\omega$ mustappear as a value of~$f$ for some argument, and so must appear on thelist. This list must therefore enumerate all of~$\Bin^\omega$.So if $\Pow{\PosInt}$ were !!{enumerable}, $\Bin^\omega$ would be!!{enumerable}. But $\Bin^\omega$ is !!{nonenumerable}(\olref[nen]{thm:nonenum-bin-omega}). Hence $\Pow{\PosInt}$ is!!{nonenumerable}.\end{proof}\begin{explain}It is easy to be confused about the direction the reduction goes in.For instance, !!a{surjective} function $g \colon \Bin^\omega \to B$does \emph{not} establish that $B$ is !!{nonenumerable}. (Consider $g\colon \Bin^\omega \to \Bin$ defined by $g(s) = s(1)$, the functionthat maps a sequence of $0$'s and $1$'s to its first !!{element}. Itis !!{surjective}, because some sequences start with $0$ and some startwith $1$. But $\Bin$ is finite.) Note also that the function~$f$ mustbe !!{surjective}, or otherwise the argument does not go through:$f(x_1)$, $f(x_2)$, \dots{} would then not be guaranteed to includeall the !!{element}s of~$B$. For instance,\[h(n) = \underbrace{000\dots0}_{\text{$n$ $0$'s}}\]defines a function $h\colon \PosInt \to\Bin^\omega$, but $\PosInt$ is !!{enumerable}.\end{explain}\begin{prob}Show that the set of all \emph{sets of} pairs of positive integers is!!{nonenumerable} by a reduction argument.\end{prob}\begin{prob}\label{sfr:siz:red:prob:nat-nat}Show that the set~$X$ of all functions $f\colon \Nat \to \Nat$ is!!{nonenumerable} by a reduction argument (Hint: give a surjectivefunction from $X$ to~$\Bin^\omega$.)\end{prob}\begin{prob}Show that $\Nat^\omega$, the set of infinite sequences ofnatural numbers, is !!{nonenumerable} by a reduction argument.\end{prob}\begin{prob}Let $P$ be the set of functions from the set of positiveintegers to the set $\{0\}$, and let $Q$ be the set of \emph{partial}functions from the set of positive integers to the set $\{0\}$. Showthat $P$~is !!{enumerable} and $Q$~is not. (Hint: reduce the problemof enumerating $\Bin^\omega$ to enumerating~$Q$).\end{prob}\begin{prob}Let $S$ be the set of all !!{surjective} functions from the set ofpositive integers to the set \{0,1\}, i.e., $S$ consists of all!!{surjective}~$f\colon \PosInt \to \Bin$. Show that $S$ is!!{nonenumerable}.\end{prob}\begin{prob}Show that the set~$\Real$ of all real numbers is !!{nonenumerable}.\end{prob}\end{document}
content/sets-functions-relations/size-of-sets/schroder-bernstein.tex
53 lines; SHA-256 7b99b3e032e24e425383734ce80ad9a5cc37d018c09205e02f37b927d50bb56a. Open the preserved source file.
% Part:sets-functions-relations% Chapter: sets% Section: schroder-bernstein\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\olfileid{sfr}{siz}{sb}\olsection{The Notion of Size, and Schr\"oder-Bernstein}\begin{explain}Here is an intuitive thought: if $A$ is no larger than $B$ and $B$ isno larger than $A$, then $A$ and $B$ are equinumerous. To be honest,if this thought were \emph{wrong}, then we could scarcely justify thethought that our defined notion of equinumerosity has anything to dowith comparisons of ``sizes'' between sets!{} Fortunately, though,the intuitive thought is correct. This is justified by theSchr\"oder-Bernstein Theorem.\end{explain}\begin{thm}[Schr\"oder-Bernstein]\ollabel{thm:schroder-bernstein}If $\cardle{A}{B}$ and $\cardle{B}{A}$,then $\cardeq{A}{B}$.\end{thm}\begin{explain}In other words, if there is !!a{injection} from $A$ to~$B$, and!!a{injection} from $B$ to~$A$, then there is !!a{bijection} from $A$to~$B$.This result, however, is really rather \emph{difficult} to prove.Indeed, although Cantor stated the result, others provedit.\footnote{For more on the history, see e.g.,\citet[pp.~165--6]{Potter2004}.}\oliflabeldef{sfr:cardinals:card-sb:sec}{We will only be ina position to \emph{prove} Schr\"oder-Bernstein in\olref[sfr][cardinals][card-sb]{sec}.}{}%For now, you can (and must)take it on trust.Fortunately, Schr\"oder-Bernstein is \emph{correct}, and itvindicates our thinking of the relations we defined, i.e.,$\cardeq{A}{B}$ and $\cardle{A}{B}$, as having something to do with``size''. Moreover, Schr\"oder-Bernstein is very \emph{useful}. Itcan be difficult to think of !!a{bijection} between two equinumeroussets. The Schr\"oder-Bernstein Theorem allows us to break the comparisondown into cases so we only have to think of !!a{injection} from thefirst to the second, and vice-versa.\end{explain}\end{document}
content/sets-functions-relations/size-of-sets/size-of-sets-complete.tex
55 lines; SHA-256 d2b1a2f68e99efc2e5fd9f15316db26d7f898bd61135213309f61d28a6f00a60. Open the preserved source file.
% Part: sets-functions-relations% Chapter: size-of-sets-complete\documentclass[../../../include/open-logic-chapter]{subfiles}\begin{document}\olchapter{sfr}{siz}{The Size of Sets}\begin{editorial}This chapter discusses enumerations, countability and uncountability.Several sections come in two versions: a more elementary one, thattakes enumerations to be lists, or surjections from $\PosInt$; and amore abstract one that defines enumerations as bijections with $\Nat$.\end{editorial}\olimport{introduction}\olimport{enumerability}\olimport{zig-zag}\olimport{pairing}\olimport{pairing-alt}\olimport{non-enumerability}\olimport{reduction}\olimport{equinumerous-sets}\olimport{comparing-size}\olimport{schroder-bernstein}\begin{editorial}The following \olref[sfr][siz][enm-alt]{sec},\olref[sfr][siz][nen-alt]{sec}, \olref[sfr][siz][red-alt]{sec} arealternative versions of \olref[sfr][siz][enm]{sec},\olref[sfr][siz][nen]{sec}, \olref[sfr][siz][red]{sec} due to TimButton for use in his Open Set Theory text. They are slightly moreadvanced and use a difference definition of enumerability moresuitable in a set theory context (i.e., bijection with $\Nat$ or aninitial segment, rather than being listable or being the range of asurjective function from $\PosInt$).\end{editorial}\olimport{enumerability-alt}\olimport{non-enumerability-alt}\olimport{reduction-alt}\OLEndChapterHook\end{document}
content/sets-functions-relations/size-of-sets/zig-zag.tex
126 lines; SHA-256 18bf058d52e22b9dbc7a08af314b58c81f35dd4009c0ccf726a0d00aec391dee. Open the preserved source file.
% Part:sets-functions-relations% Chapter: size-of-sets% Section: zig-zag\documentclass[../../../include/open-logic-section]{subfiles}\begin{document}\olfileid{sfr}{siz}{zigzag}\olsection{Cantor's Zig-Zag Method}\begin{explain}We've already considered some ``easy'' enumerations. Now we willconsider something a bit harder. Consider the set of pairs of naturalnumbers\oliflabeldef{sfr:set:pai:sec}{, which we defined in\olref[set][pai]{sec} thus:}{defined by:}\[\Nat \times \Nat = \Setabs{\tuple{n,m}}{n,m \in \Nat}\]We can organize these ordered pairs into an \emph{array}, like so:\[\begin{array}{ c | c | c | c | c | c}& \mathbf 0 & \mathbf 1 & \mathbf 2 & \mathbf 3 & \dots \\\hline\mathbf 0 & \tuple{0,0} & \tuple{0,1} & \tuple{0,2} & \tuple{0,3} & \dots \\\hline\mathbf 1 & \tuple{1,0} & \tuple{1,1} & \tuple{1,2} & \tuple{1,3} & \dots \\\hline\mathbf 2 & \tuple{2,0} & \tuple{2,1} & \tuple{2,2} & \tuple{2,3} & \dots \\\hline\mathbf 3 & \tuple{3,0} & \tuple{3,1} & \tuple{3,2} & \tuple{3,3} & \dots \\\hline\vdots & \vdots & \vdots & \vdots & \vdots & \ddots\\\end{array}\]Clearly, every ordered pair in $\Nat \times \Nat$ will appearexactly once in the array. In particular, $\tuple{n,m}$ will appear inthe $n$th row and $m$th column. But how do we organize the elements ofsuch an array into a ``one-dimensional'' list? The pattern in the array belowdemonstrates one way to do this (although of course there are many other options):\[\begin{array}{ c | c | c | c | c | c | c}& \mathbf 0 & \mathbf 1 & \mathbf 2 & \mathbf 3 & \mathbf 4 &\dots \\\hline\mathbf 0 & 0 & 1& 3 & 6& 10 &\ldots \\\hline\mathbf 1 &2 & 4& 7 & 11 & \dots &\ldots \\\hline\mathbf 2 & 5 & 8 & 12 & \ldots & \dots&\ldots \\\hline\mathbf 3 & 9 & 13 & \ldots & \ldots & \dots & \ldots \\\hline\mathbf 4 & 14 & \ldots & \ldots & \ldots & \dots & \ldots \\\hline\vdots & \vdots & \vdots & \vdots & \vdots&\ldots & \ddots\\\end{array}\]\noindentThis pattern is called \emph{Cantor's zig-zag method}. It enumerates$\Nat \times \Nat$ as follows:\[\tuple{0,0}, \tuple{0,1}, \tuple{1,0}, \tuple{0,2}, \tuple{1,1},\tuple{2,0}, \tuple{0,3}, \tuple{1,2}, \tuple{2,1}, \tuple{3,0}, \dots\]And this establishes the following:\end{explain}\begin{prop}\ollabel{natsquaredenumerable}$\Nat \times \Nat$ is !!{enumerable}.\end{prop}\begin{proof}Let $f \colon \Nat \to \Nat\times\Nat$ take each $k \in \Nat$ to thetuple $\tuple{n,m} \in \Nat \times \Nat$ such that $k$ is the value ofthe $n$th row and $m$th column in Cantor's zig-zag array.\end{proof}\begin{explain}This technique also generalises rather nicely. For example, we can useit to enumerate the set of ordered triples of natural numbers, i.e.:\[\Nat \times \Nat \times \Nat = \Setabs{\tuple{n,m,k}}{n,m,k \in \Nat}\]We think of $\Nat \times \Nat \times \Nat$ as the Cartesianproduct of $\Nat \times \Nat$ with $\Nat$, that is,\[\Nat^3 = (\Nat \times \Nat) \times \Nat =\Setabs{\tuple{\tuple{n,m},k}}{n, m, k\in \Nat }\]and thus we can enumerate $\Nat^3$ with an array by labelling oneaxis with the enumeration of $\Nat$, and the other axis with theenumeration of $\Nat^2$:\[\begin{array}{ c | c | c | c | c | c}& \mathbf 0 & \mathbf 1 & \mathbf 2 & \mathbf 3 & \dots \\\hline\mathbf{\tuple{0,0}} & \tuple{0,0,0} & \tuple{0,0,1} & \tuple{0,0,2} & \tuple{0,0,3} & \dots \\\hline\mathbf{\tuple{0,1}} & \tuple{0,1,0} & \tuple{0,1,1} & \tuple{0,1,2} & \tuple{0,1,3} & \dots \\\hline\mathbf{\tuple{1,0}} & \tuple{1,0,0} & \tuple{1,0,1} & \tuple{1,0,2} & \tuple{1,0,3} & \dots \\\hline\mathbf{\tuple{0,2}} & \tuple{0,2,0} & \tuple{0,2,1} & \tuple{0,2,2} & \tuple{0,2,3} & \dots\\\hline\vdots & \vdots & \vdots & \vdots & \vdots & \ddots \\\end{array}\]Thus, by using a method like Cantor's zig-zag method, we may similarlyobtain an enumeration of~$\Nat^3$. And we can keep going, obtainingenumerations of $\Nat^n$ for any natural number $n$. So, we have:\end{explain}\begin{prop}$\Nat^n$ is !!{enumerable}, for every $n \in \Nat$.\end{prop}\begin{prob}\label{sfr:siz:zigzag:prob:posint-n}Show that $(\PosInt)^n$ is !!{enumerable}, for every $n \in \Nat$.\end{prob}\begin{prob}\label{sfr:siz:zigzag:prob:posint-star}Show that $(\PosInt)^*$ is !!{enumerable}. You may assume \cref{sfr:siz:zigzag:prob:posint-n}.\end{prob}\end{document}