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.

  1. % Part:sets-functions-relations
  2. % Chapter: size-of-sets
  3. % Section: comparing-sizes
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{sfr}{siz}{car}
  7. \olsection{Sets of Different Sizes, and Cantor's Theorem}
  8. \begin{explain}
  9. We have offered a precise statement of the idea that two sets have the
  10. same size. We can also offer a precise statement of the idea that one
  11. set is smaller than another. Our definition of ``is smaller than (or
  12. equinumerous)'' will require, instead of !!a{bijection} between the
  13. sets, !!a{injection} from the first set to the second. If such a
  14. function exists, the size of the first set is less than or equal to
  15. the size of the second. Intuitively, !!a{injection} from one set to
  16. another guarantees that the range of the function has at least as many
  17. !!{element}s as the domain, since no two !!{element}s of the domain
  18. map to the same !!{element} of the range.
  19. \end{explain}
  20. \begin{defn}
  21. $A$ is \emph{no larger than}~$B$, written $\cardle{A}{B}$, iff there
  22. is !!a{injection} $f \colon A \to B$.
  23. \end{defn}
  24. It is clear that this is a reflexive and transitive relation, but that
  25. it is not symmetric (this is left as an exercise). We can also
  26. introduce a notion, which states that one set is (strictly) smaller
  27. than another.
  28. \begin{defn}
  29. $A$ is \emph{smaller than}~$B$, written $\cardless{A}{B}$, iff there
  30. is !!a{injection}~$f\colon A \to B$ but no !!{bijection}~$g\colon A
  31. \to B$, i.e., $\cardle{A}{B}$ and $\cardneq{A}{B}$.
  32. \end{defn}
  33. It is clear that this relation is irreflexive
  34. and transitive. (This is left as an exercise.) Using this notation, we
  35. can say that a set $A$ is !!{enumerable} iff $\cardle{A}{\Nat}$, and
  36. that $A$ is !!{nonenumerable} iff $\cardless{\Nat}{A}$. This allows us
  37. to restate
  38. \oliflabeldef{sfr:siz:nen-alt:thm:nonenum-pownat}{%
  39. \olref[sfr][siz][nen-alt]{thm:nonenum-pownat}
  40. as the observation that
  41. $\cardless{\Nat}{\Pow{\Nat}}$}{%
  42. \olref[sfr][siz][nen]{thm:nonenum-pownat}
  43. as the observation that $\cardless{\PosInt}{\Pow{\PosInt}}$}. In fact,
  44. \citet{Cantor1892} proved that this last point is \emph{perfectly
  45. general}:
  46. \begin{thm}[Cantor]\ollabel{thm:cantor}
  47. $\cardless{A}{\Pow{A}}$, for any set $A$.
  48. \end{thm}
  49. \begin{proof}
  50. The map $f(x) = \{x\}$ is !!a{injection} $f \colon A \to \Pow{A}$,
  51. since if $x \neq y$, then also $\{x\} \neq \{y\}$ by extensionality,
  52. and so $f(x) \neq f(y)$. So we have that $\cardle{A}{\Pow{A}}$.
  53. \begin{editorial}
  54. We present the slow proof if \olref[nen]{sec} is
  55. present, otherwise a faster proof matching \olref[nen-alt]{sec}.
  56. \end{editorial}
  57. \oliflabeldef{sfr:siz:nen:sec}{%
  58. We will now show that there cannot be !!a{surjective} function~$g\colon A \to
  59. \Pow{A}$, let alone !!a{bijective} one, and hence that
  60. $\cardneq{A}{\Pow{A}}$. For suppose that $g\colon A \to \Pow{A}$.
  61. Since $g$ is total, every $x \in A$ is mapped to a subset $g(x)
  62. \subseteq A$. We can show that $g$ cannot be surjective. To do this, we
  63. define a subset~$\overline{A} \subseteq A$ which by definition cannot be in the
  64. range of~$g$. Let
  65. \[
  66. \overline{A} = \Setabs{x \in A}{x \notin g(x)}.
  67. \]
  68. Since $g(x)$ is defined for all $x \in A$, $\overline{A}$ is clearly
  69. a well-defined subset of~$A$. But, it cannot be in the range
  70. of~$g$. Let $x \in A$ be arbitrary, we will show that $\overline{A} \neq
  71. g(x)$. If $x \in g(x)$, then it does not satisfy $x \notin g(x)$,
  72. and so by the definition of~$\overline{A}$, we have $x \notin
  73. \overline{A}$. If $x \in \overline{A}$, it must satisfy the
  74. defining property of~$\overline{A}$, i.e., $x \in A$ and $x \notin
  75. g(x)$. Since $x$ was arbitrary, this shows that for each $x \in
  76. \overline{A}$, $x \in g(x)$ iff $x \notin \overline{A}$, and so
  77. $g(x) \neq \overline{A}$. In other words, $\overline{A}$ cannot be
  78. in the range of~$g$, contradicting the assumption that~$g$ is
  79. surjective.}{It remains to show that $\cardneq{A}{\Pow{A}}$. For
  80. reductio, suppose $\cardeq{A}{\Pow{A}}$, i.e., there is some
  81. !!{bijection} $g \colon A \to \Pow{A}$. Now consider:
  82. \[
  83. D = \Setabs{x \in A}{x \notin g(x)}
  84. \]
  85. Note that $D \subseteq A$, so that $D \in \Pow{A}$. Since $g$ is
  86. !!a{bijection}, there is some $y \in A$ such that $g(y) = D$. But
  87. now we have:
  88. \[
  89. y \in g(y) \text{ iff } y \in D \text{ iff } y \notin g(y).
  90. \]
  91. This is a contradiction; so $\cardneq{A}{\Pow{A}}$.}{}
  92. \end{proof}
  93. \begin{explain}
  94. \oliflabeldef{sfr:siz:nen:thm:nonenum-pownat}{It's instructive to
  95. compare the proof of \olref{thm:cantor} to that of
  96. \olref[nen]{thm:nonenum-pownat}. There we showed that for any list
  97. $Z_1$, $Z_2$, \dots, of subsets of~$\PosInt$ one can construct a
  98. set~$\overline{Z}$ of numbers guaranteed not to be on the list. It
  99. was guaranteed not to be on the list because, for every $n \in
  100. \PosInt$, $n \in Z_n$ iff $n \notin \overline{Z}$. This way, there
  101. is always some number that is !!a{element} of one of $Z_n$ or
  102. $\overline{Z}$ but not the other. We follow the same idea here,
  103. except the indices~$n$ are now !!{element}s of~$A$ instead
  104. of~$\PosInt$. The set $\overline{A}$ is defined so that it is
  105. different from~$g(x)$ for each $x \in A$, because $x \in g(x)$ iff
  106. $x \notin \overline{A}$. Again, there is always !!a{element} of~$A$
  107. which is !!a{element} of one of $g(x)$ and $\overline{A}$ but not
  108. the other. And just as $\overline{Z}$ therefore cannot be on the
  109. list $Z_1$, $Z_2$, \dots, $\overline{A}$ cannot be in the range
  110. of~$g$.}{}
  111. \oliflabeldef{sfr:siz:nen-alt:thm:nonenum-pownat}{It's instructive to
  112. compare the proof of \olref{thm:cantor} to that of
  113. \olref[nen-alt]{thm:nonenum-pownat}. There we showed that for any
  114. list $N_0$, $N_1$, $N_2$, \dots, of subsets of~$\Nat$ we can construct a
  115. set~$D$ of numbers guaranteed not to be on the list. It was
  116. guaranteed not to be on the list because $n \in N_n$ iff $n \notin
  117. D$, for every $n \in \Nat$. We follow the same idea here, except the
  118. indices~$n$ are now !!{element}s of~$A$ rather than of~$\Nat$. The
  119. set $D$ is defined so that it is different from~$g(x)$ for each $x
  120. \in A$, because $x \in g(x)$ iff $x \notin D$.}{}
  121. The proof is also worth comparing with the proof of Russell's Paradox,
  122. \olref[sfr][set][rus]{thm:russells-paradox}. Indeed, Cantor's Theorem was
  123. the inspiration for Russell's own paradox.
  124. \end{explain}
  125. \begin{prob}
  126. Show that there cannot be !!a{injection} $g\colon \Pow{A} \to
  127. A$, for any set~$A$. Hint: Suppose $g\colon \Pow{A} \to A$ is
  128. !!{injective}. Consider $D = \Setabs{g(B)}{B \subseteq A \text{ and
  129. } g(B) \notin B}$. Let $x = g(D)$. Use the fact that $g$ is
  130. !!{injective} to derive a contradiction.
  131. \end{prob}
  132. \end{document}

content/sets-functions-relations/size-of-sets/enumerability-alt.tex

135 lines; SHA-256 8ad8d8941a5ca6d1b4cd2cc351fc16a912d00273783c0358838dd4fa51fb4627. Open the preserved source file.

  1. % Part:sets-functions-relations
  2. % Chapter: size-of-sets
  3. % Section: enumerations-alt
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{sfr}{siz}{enm-alt}
  7. \olsection{Enumerations and \usetoken{S}{enumerable} Sets}
  8. \begin{editorial}
  9. This section defines enumerations as bijections with (initial
  10. segments) of $\Nat$, the way it's done in set theory. So it
  11. conflicts slightly with the definitions in \olref[enm]{sec}, and
  12. repeats all the examples there. It is also a bit more terse than
  13. that section.
  14. \end{editorial}
  15. We can specify finite set is by simply enumerating its
  16. !!{element}s. We do this when we define a set like so:
  17. \[
  18. A = \{a_1, a_2, \ldots, a_n\}.
  19. \]
  20. Assuming that the !!{element}s $a_1$, \dots, $a_n$ are all distinct,
  21. this gives us !!a{bijection} between $A$ and the first $n$ natural
  22. numbers $0$, \dots, $n-1$. Conversely, since every finite set has only
  23. finitely many !!{element}s, every finite set can be put into such a
  24. correspondence. In other words, if $A$ is finite, there is
  25. !!a{bijection} between $A$ and $\{0, \dots, n-1\}$, where $n$ is the
  26. number of !!{element}s of~$A$.
  27. If we allow for certain kinds of infinite sets, then we will also
  28. allow some infinite sets to be enumerated. We can make this precise by
  29. saying that an infinite set is enumerated by !!a{bijection} between it
  30. and all of~$\Nat$.
  31. \begin{defn}[Enumeration, set-theoretic]
  32. An \emph{enumeration} of a set $A$ is !!a{bijection} whose range is
  33. $A$ and whose domain is either an initial set of natural numbers $\{0,
  34. 1, \ldots, n\}$ {or} the entire set of natural numbers~$\Nat$.
  35. \end{defn}
  36. \begin{explain}
  37. There is an intuitive underpinning to this use of the word
  38. \emph{enumeration}. For to say that we have enumerated a set $A$ is to
  39. say that there is !!a{bijection} $f$ which allows us to count out the
  40. elements of the set $A$. The $0$th element is $f(0)$, the 1st is
  41. $f(1)$, \ldots the $n$th is $f(n)$\ldots.\footnote{Yes, we count
  42. from $0$. Of course we could also start with~$1$. This would
  43. make no big difference. We would just have to replace~$\Nat$
  44. by~$\PosInt$.} The rationale for this may be made even clearer by
  45. adding the following:
  46. \end{explain}
  47. \begin{defn}
  48. \ollabel{defn:enumerable}
  49. A set~$A$ is !!{enumerable} iff either $A = \emptyset$ or there is
  50. an enumeration of~$A$. We say that $A$ is !!{nonenumerable} iff $A$
  51. is not !!{enumerable}.
  52. \end{defn}
  53. \begin{explain}
  54. So a set is !!{enumerable} iff it is empty or you can use an
  55. enumeration to count out its !!{element}s.
  56. \end{explain}
  57. \begin{ex}
  58. A function enumerating the natural numbers is simply the identity
  59. function $\Id{\Nat} \colon \Nat \to \Nat$ given by $\Id{\Nat}(n) = n$. A
  60. function enumerating the \emph{positive} natural numbers, $\Nat^+ =
  61. \Nat \setminus \{0\}$, is the function $g(n) = n + 1$, i.e., the
  62. successor function.
  63. \end{ex}
  64. \begin{prob}
  65. Show that a set $A$ is !!{enumerable} iff either $A = \emptyset$ or
  66. there is !!a{surjection} $f\colon \Nat \to A$. Show that $A$ is
  67. !!{enumerable} iff there is !!a{injection} $g\colon A \to \Nat$.
  68. \end{prob}
  69. \begin{ex}
  70. The functions $f\colon \Nat \to \Nat$ and $g \colon \Nat \to \Nat$
  71. given by
  72. \begin{align*}
  73. f(n) & = 2n \text{ and}\\
  74. g(n) & = 2n+1
  75. \end{align*}
  76. respectively enumerate the even natural numbers and the odd natural
  77. numbers. But neither is !!{surjective}, so neither is an enumeration
  78. of $\Nat$.
  79. \end{ex}
  80. \begin{prob}
  81. Define an enumeration of the square numbers $1$, $4$, $9$, $16$, \dots
  82. \end{prob}
  83. \begin{ex}
  84. Let $\lceil x \rceil$ be the \emph{ceiling} function, which rounds $x$
  85. up to the nearest integer. Then the function $f \colon \Nat \to \Int$
  86. given by:
  87. \[
  88. f(n) = (-1)^{n} \left\lceil\tfrac{n}{2}\right\rceil
  89. \]
  90. enumerates the set of
  91. integers~$\Int$ as follows:
  92. \[
  93. \begin{array}{c c c c c c c c}
  94. f(0) & f(1) & f(2) & f(3) & f(4) & f(5) & f(6) & \dots \\ \\
  95. \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 \\ \\
  96. 0 & -1 & 1 & -2 & 2 & -3 & 3& \dots
  97. \end{array}
  98. \]
  99. Notice how $f$ generates the values of $\Int$ by ``hopping'' back and
  100. forth between positive and negative integers. You can also think of
  101. $f$ as defined by cases as follows:
  102. \[
  103. f(n) = \begin{cases}
  104. \frac{n}{2} & \text{if $n$ is even}\\
  105. -\frac{n+1}{2} & \text{if $n$ is odd}
  106. \end{cases}
  107. \]
  108. \end{ex}
  109. \begin{prob}
  110. Show that if $A$ and $B$ are !!{enumerable}, so is $A \cup B$.
  111. \end{prob}
  112. \begin{prob}
  113. Show by induction on $n$ that if $A_1$, $A_2$, \dots, $A_n$ are all
  114. !!{enumerable}, so is $A_1 \cup \dots \cup A_n$.
  115. \end{prob}
  116. \end{document}

content/sets-functions-relations/size-of-sets/enumerability.tex

279 lines; SHA-256 7657db317a07eef9cd5497ad88997483dd43c9f94f27d257abe857084886a2fe. Open the preserved source file.

  1. % Part:sets-functions-relations
  2. % Chapter: size-of-sets
  3. % Section: enumerations
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{sfr}{siz}{enm}
  7. \olsection{Enumerations and \usetoken{S}{enumerable} Sets}
  8. \begin{editorial}
  9. This section discusses enumerations of sets, defining them as
  10. surjections from $\PosInt$. It does things slowly, for readers with
  11. little mathematical background. An alternative, terser
  12. version is given in \olref[enm-alt]{sec}, which defines enumerations
  13. differently: as bijections with $\Nat$ (or an initial segment).
  14. \end{editorial}
  15. \begin{explain}
  16. We've already given examples of sets by listing their !!{element}s.
  17. Let's discuss in more general terms how and when we can list the
  18. !!{element}s of a set, even if that set is infinite.
  19. \end{explain}
  20. \begin{defn}[Enumeration, informally]
  21. Informally, an \emph{enumeration} of a set~$A$ is a list (possibly
  22. infinite) of !!{element}s of~$A$ such that every !!{element} of $A$
  23. appears on the list at some finite position. If $A$ has an
  24. enumeration, then $A$ is said to be \emph{!!{enumerable}}.
  25. \end{defn}
  26. \begin{explain}
  27. A couple of points about enumerations:
  28. \begin{enumerate}
  29. \item We count as enumerations only lists which have a beginning and
  30. in which every !!{element} other than the first has a single
  31. !!{element} immediately preceding it. In other words, there are
  32. only finitely many elements between the first !!{element} of the
  33. list and any other !!{element}. In particular, this means that every
  34. !!{element} of an enumeration has a finite position: the first
  35. !!{element} has position~$1$, the second position~$2$, etc.
  36. \item We can have different enumerations of the same set~$A$ which
  37. differ by the order in which the !!{element}s appear: $4$, $1$,
  38. $25$, $16$,~$9$ enumerates the (set of the) first five square
  39. numbers just as well as $1$, $4$, $9$, $16$,~$25$ does.
  40. \item Redundant enumerations are still enumerations: $1$, $1$, $2$,
  41. $2$, $3$, $3$,~\dots{} enumerates the same set as $1$, $2$,
  42. $3$,~\dots{} does.
  43. \item Order and redundancy \emph{do} matter when we specify an
  44. enumeration: we can enumerate the positive integers beginning with
  45. $1$, $2$, $3$, $1$, \dots{}, but the pattern is easier to see when
  46. enumerated in the standard way as $1$, $2$, $3$, $4$,~\dots
  47. \item Enumerations must have a beginning: \dots, $3$, $2$, $1$ is not
  48. an enumeration of the positive integers because it has no first
  49. !!{element}. To see how this follows from the informal definition,
  50. ask yourself, ``at what position in the list does the number 76
  51. appear?''
  52. \item The following is not an enumeration of the positive integers:
  53. $1$, $3$, $5$, \dots, $2$, $4$, $6$, \dots\@ The problem is that the
  54. even numbers occur at places $\infty + 1$, $\infty + 2$, $\infty +
  55. 3$, rather than at finite positions.
  56. \item The empty set is enumerable: it is enumerated by the empty list!{}
  57. \end{enumerate}
  58. \end{explain}
  59. \begin{prop}
  60. If $A$ has an enumeration, it has an enumeration without
  61. repetitions.
  62. \end{prop}
  63. \begin{proof}
  64. Suppose $A$ has an enumeration $x_1$, $x_2$, \dots{} in which each
  65. $x_i$ is an !!{element} of~$A$. We can remove repetitions from an
  66. enumeration by removing repeated !!{element}s. For instance, we can
  67. turn the enumeration into a new one in which we list $x_i$ if
  68. it is !!a{element} of~$A$ that is not among $x_1$, \dots,
  69. $x_{i-1}$ or remove $x_i$ from the list if it already appears among
  70. $x_1$, \dots,~$x_{i-1}$.
  71. \end{proof}
  72. The last argument shows that in order to get a good handle on
  73. enumerations and !!{enumerable} sets and to prove things about them,
  74. we need a more precise definition. The following provides it.
  75. \begin{defn}[Enumeration, formally]
  76. An \emph{enumeration} of a set $A \neq \emptyset$ is any
  77. !!{surjective} function $f \colon \PosInt \to A$.
  78. \end{defn}
  79. \begin{explain}
  80. Let's convince ourselves that the formal definition and the informal
  81. definition using a possibly infinite list are equivalent. First, any
  82. !!{surjective} function from $\PosInt$ to a set~$A$ enumerates~$A$.
  83. Such a function determines an enumeration as defined informally above:
  84. the list $f(1)$, $f(2)$, $f(3)$, \dots. Since $f$ is !!{surjective},
  85. every !!{element} of~$A$ is guaranteed to be the value of~$f(n)$ for
  86. some~$n \in \PosInt$. Hence, every !!{element} of $A$ appears at some
  87. finite position in the list. Since the function may not be
  88. !!{injective}, the list may be redundant, but that is acceptable (as
  89. noted above).
  90. On the other hand, given a list that enumerates all !!{element}s
  91. of~$A$, we can define !!a{surjective} function $f\colon \PosInt \to A$
  92. by letting $f(n)$ be the $n$th !!{element} of the list, or the final
  93. !!{element} of the list if there is no $n$th !!{element}. The only
  94. case where this does not produce !!a{surjective} function is when $A$ is
  95. empty, and hence the list is empty. So, every non-empty list
  96. determines !!a{surjective} function $f\colon \PosInt \to A$.
  97. \end{explain}
  98. \begin{defn}
  99. \ollabel{defn:enumerable}
  100. A set~$A$ is !!{enumerable} iff it is empty or has an enumeration.
  101. \end{defn}
  102. \begin{ex}
  103. A function enumerating the positive integers ($\PosInt$) is simply the
  104. identity function given by $f(n) = n$. A function enumerating the
  105. natural numbers $\Nat$ is the function $g(n) = n - 1$.
  106. \end{ex}
  107. \begin{ex}
  108. The functions $f\colon \PosInt \to \PosInt$ and $g \colon \PosInt \to
  109. \PosInt$ given by
  110. \begin{align*}
  111. f(n) & = 2n \text{ and}\\
  112. g(n) & = 2n - 1
  113. \end{align*}
  114. enumerate the even positive integers and the odd positive integers,
  115. respectively. However, neither function is an enumeration of
  116. $\PosInt$, since neither is !!{surjective}.
  117. \end{ex}
  118. \begin{prob}
  119. Define an enumeration of the positive squares $1$, $4$, $9$, $16$, \dots
  120. \end{prob}
  121. \begin{ex}
  122. The function $f(n) = (-1)^{n} \lceil \frac{(n-1)}{2}\rceil$ (where
  123. $\lceil x \rceil$ denotes the \emph{ceiling} function, which rounds
  124. $x$ up to the nearest integer) enumerates the set of
  125. integers~$\Int$. Notice how $f$ generates the values of $\Int$ by
  126. ``hopping'' back and forth between positive and negative integers:
  127. \[
  128. \begin{array}{c c c c c c c c}
  129. f(1) & f(2) & f(3) & f(4) & f(5) & f(6) & f(7) & \dots \\ \\
  130. - \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}
  131. \rceil & - \lceil \tfrac{6}{2} \rceil & \dots \\ \\
  132. 0 & 1 & -1 & 2 & -2 & 3 & \dots
  133. \end{array}
  134. \]
  135. You can also think of $f$ as defined by cases as follows:
  136. \[
  137. f(n) = \begin{cases}
  138. 0 & \text{if $n = 1$}\\
  139. n/2 & \text{if $n$ is even}\\
  140. -(n-1)/2 & \text{if $n$ is odd and $>1$}
  141. \end{cases}
  142. \]
  143. \end{ex}
  144. \begin{prob}
  145. Show that if $A$ and $B$ are !!{enumerable}, so is $A \cup B$. To do
  146. this, suppose there are !!{surjective} functions $f\colon \PosInt \to
  147. A$ and $g\colon \PosInt \to B$, and define !!a{surjective}
  148. function~$h\colon \PosInt \to A \cup B$ and prove that it is
  149. !!{surjective}. Also consider the cases where $A$ or~$B = \emptyset$.
  150. \end{prob}
  151. \begin{prob}
  152. Show that if $B \subseteq A$ and $A$ is !!{enumerable}, so is~$B$. To
  153. do this, suppose there is !!a{surjective} function $f\colon \PosInt \to
  154. A$. Define !!a{surjective} function~$g\colon \PosInt \to B$ and prove
  155. that it is !!{surjective}. What happens if $B = \emptyset$?
  156. \end{prob}
  157. \begin{prob}
  158. Show by induction on $n$ that if $A_1$, $A_2$, \dots, $A_n$ are all
  159. !!{enumerable}, so is $A_1 \cup \dots \cup A_n$. You may assume the
  160. fact that if two sets $A$ and~$B$ are !!{enumerable}, so is~$A \cup
  161. B$.
  162. \end{prob}
  163. Although it is perhaps more natural when listing the !!{element}s of a
  164. set to start counting from the $1$st !!{element}, mathematicians like
  165. to use the natural numbers~$\Nat$ for counting things. They
  166. talk about the $0$th, $1$st, $2$nd, and so on, !!{element}s of a list.
  167. Correspondingly, we can define an enumeration as !!a{surjective}
  168. function from $\Nat$ to~$A$. Of course, the two definitions are
  169. equivalent.
  170. \begin{prop}\ollabel{prop:enum-shift}
  171. There is !!a{surjection} $f\colon \PosInt \to A$ iff there is
  172. !!a{surjection} $g\colon \Nat \to A$.
  173. \end{prop}
  174. \begin{proof}
  175. Given !!a{surjection} $f\colon \PosInt \to A$, we can define $g(n) =
  176. f(n+1)$ for all $n \in \Nat$. It is easy to see that $g\colon \Nat
  177. \to A$ is !!{surjective}. Conversely, given !!a{surjection} $g\colon
  178. \Nat \to A$, define $f(n) = g(n-1)$.
  179. \end{proof}
  180. This gives us the following result:
  181. \begin{cor}\ollabel{cor:enum-nat}
  182. A set $A$ is !!{enumerable} iff it is empty or there is
  183. !!a{surjective} function $f\colon \Nat \to A$.
  184. \end{cor}
  185. We discussed above that a list of !!{element}s of a set~$A$ can be
  186. turned into a list without repetitions. This is also true for
  187. enumerations, but a bit harder to formulate and prove rigorously. Any
  188. function $f\colon \PosInt \to A$ must be defined for all $n \in
  189. \PosInt$. If there are only finitely many !!{element}s in~$A$ then we
  190. clearly cannot have a function defined on the infinitely many
  191. !!{element}s of~$\PosInt$ that takes as values all the !!{element}s
  192. of~$A$ but never takes the same value twice. In that case, i.e., in
  193. the case where the list without repetitions is finite, we must choose
  194. a different domain for~$f$, one with only finitely many !!{element}s.
  195. Not having repetitions means that $f$ must be !!{injective}. Since it
  196. is also !!{surjective}, we are looking for !!a{bijection} between some
  197. finite set $\{1, \dots, n\}$ or $\PosInt$ and~$A$.
  198. \begin{prop}\ollabel{prop:enum-bij}
  199. If $f\colon \PosInt \to A$ is !!{surjective} (i.e., an enumeration
  200. of~$A$), there is !!a{bijection} $g\colon Z \to A$ where $Z$ is
  201. either~$\PosInt$ or $\{1, \dots, n\}$ for some~$n \in \PosInt$.
  202. \end{prop}
  203. \begin{proof}
  204. We define the function $g$ recursively: Let $g(1) = f(1)$. If $g(i)$
  205. has already been defined, let $g(i+1)$ be the first value of $f(1)$,
  206. $f(2)$, \dots{} not already among $g(1)$, \dots, $g(i)$, if there is
  207. one. If $A$ has just $n$ !!{element}s, then $g(1)$, \dots, $g(n)$ are all
  208. defined, and so we have defined a function $g\colon \{1, \dots, n\}
  209. \to A$. If $A$ has infinitely many !!{element}s, then for any $i$
  210. there must be !!a{element} of~$A$ in the enumeration $f(1)$, $f(2)$,
  211. \dots, which is not already among $g(1)$, \dots, $g(i)$. In this
  212. case we have defined a function $g\colon \PosInt \to A$.
  213. The function $g$ is !!{surjective}, since any element of~$A$ is
  214. among $f(1)$, $f(2)$, \dots{} (since $f$ is !!{surjective}) and so
  215. will eventually be a value of~$g(i)$ for some~$i$. It is also
  216. !!{injective}, since if there were $j < i$ such that $g(j) = g(i)$,
  217. then $g(i)$ would already be among $g(1)$, \dots, $g(i-1)$, contrary
  218. to how we defined~$g$.
  219. \end{proof}
  220. \begin{cor}\ollabel{cor:enum-nat-bij}
  221. A set $A$ is !!{enumerable} iff it is empty or there is !!a{bijection}
  222. $f\colon N \to A$ where either $N = \Nat$ or $N = \{0, \dots, n\}$ for
  223. some $n \in \Nat$.
  224. \end{cor}
  225. \begin{proof}
  226. $A$ is !!{enumerable} iff $A$ is empty or there is !!a{surjective}
  227. $f\colon \PosInt \to A$. By \olref{prop:enum-bij}, the latter holds
  228. iff there is !!a{bijective} function~$f\colon Z \to A$ where $Z =
  229. \PosInt$ or $Z = \{1, \dots, n\}$ for some $n \in \PosInt$. By the
  230. same argument as in the proof of \olref{prop:enum-shift}, that in turn
  231. is the case iff there is !!a{bijection} $g\colon N \to A$ where either
  232. $N = \Nat$ or $N = \{0, \dots, n-1\}$.
  233. \end{proof}
  234. \begin{prob}
  235. According to \olref[sfr][siz][enm]{defn:enumerable}, a set $A$ is
  236. enumerable iff $A = \emptyset$ or there is !!a{surjective} $f\colon
  237. \PosInt \to A$. It is also possible to define ``!!{enumerable} set''
  238. precisely by: a set is enumerable iff there is !!a{injective}
  239. function $g\colon A \to \PosInt$. Show that the definitions are
  240. equivalent, i.e., show that there is !!a{injective} function
  241. $g\colon A \to \PosInt$ iff either $A = \emptyset$ or there is
  242. !!a{surjective} $f\colon \PosInt \to A$.
  243. \end{prob}
  244. \end{document}

content/sets-functions-relations/size-of-sets/equinumerous-sets.tex

111 lines; SHA-256 7b0444e3293b300b72b7a6d49638913a778f5131fd94650dd64a5f11040c91f2. Open the preserved source file.

  1. % Part:sets-functions-relations
  2. % Chapter: size-of-sets
  3. % Section: equinumerous-sets
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{sfr}{siz}{equ}
  7. \olsection{Equinumerosity}
  8. We have an intuitive notion of ``size'' of sets, which works fine for
  9. finite sets. But what about infinite sets? If we want to come up with
  10. a formal way of comparing the sizes of two sets of \emph{any} size, it
  11. is a good idea to start by defining when sets are the same size. Here
  12. is Frege:
  13. \begin{quote}
  14. If a waiter wants to be sure that he has laid exactly as many knives
  15. as plates on the table, he does not need to count either of them, if
  16. he simply lays a knife to the right of each plate, so that every
  17. knife on the table lies to the right of some plate. The plates and
  18. knives are thus uniquely correlated to each other, and indeed
  19. through that same spatial relationship. \citep[\S70]{Frege1884}
  20. \end{quote}
  21. The insight of this passage can be brought out through a formal
  22. definition:
  23. \begin{defn}\ollabel{comparisondef}
  24. $A$ is \emph{equinumerous} with $B$, written $\cardeq{A}{B}$, iff
  25. there is !!a{bijection} $f \colon A \to B$.
  26. \end{defn}
  27. \begin{prop}\ollabel{equinumerosityisequi}
  28. Equinumerosity is an equivalence relation.
  29. \end{prop}
  30. \begin{proof}
  31. We must show that equinumerosity is reflexive, symmetric, and
  32. transitive. Let $A, B$, and $C$ be sets.
  33. \emph{Reflexivity.} The identity map $\Id{A} \colon A \to A$, where
  34. $\Id{A} (x) = x$ for all $x \in A$, is !!a{bijection}. So
  35. $\cardeq{A}{A}$.
  36. \emph{Symmetry.} Suppose $\cardeq{A}{B}$, i.e., there is
  37. !!a{bijection} $f\colon A \to B$. Since $f$ is !!{bijective}, its
  38. inverse $f^{-1}$ exists and is also !!{bijective}. Hence,
  39. $f^{-1}\colon B \to A$ is !!a{bijection}, so $\cardeq{B}{A}$.
  40. \emph{Transitivity.} Suppose that $\cardeq{A}{B}$ and $\cardeq{B}{C}$,
  41. i.e., there are !!{bijection}s $f\colon A \to B$ and $g\colon B \to
  42. C$. Then the composition $\comp{f}{g}\colon A \to C$ is !!{bijective},
  43. so that $\cardeq{A}{C}$.
  44. \end{proof}
  45. \begin{prop}
  46. If $\cardeq{A}{B}$, then $A$ is !!{enumerable} if
  47. and only if $B$ is.
  48. \end{prop}
  49. \begin{editorial}
  50. The following proof uses \olref[enm]{defn:enumerable} if
  51. \olref[enm]{sec} is included and \olref[enm-alt]{defn:enumerable}
  52. otherwise.
  53. \end{editorial}
  54. \begin{proof}
  55. Suppose $\cardeq{A}{B}$, so there is some !!{bijection} $f \colon A
  56. \to B$, and suppose that $A$ is !!{enumerable}.
  57. \oliflabeldef{sfr:siz:enm:defn:enumerable}{
  58. Then either $A = \emptyset$ or there is !!a{surjective} function
  59. $g\colon \PosInt \to A$. If $A = \emptyset$, then $B = \emptyset$
  60. also (otherwise there would be !!a{element}~$y \in B$ but no $x \in
  61. A$ with $g(x) = y$). If, on the other hand, $g\colon \PosInt \to A$
  62. is !!{surjective}, then $\comp{g}{f} \colon \PosInt \to B$ is
  63. !!{surjective}. To see this, let $y \in B$. Since $f$ is
  64. !!{surjective}, there is an $x \in A$ such that $f(x) = y$. Since
  65. $g$ is !!{surjective}, there is an $n \in \PosInt$ such that $g(n) =
  66. x$. Hence,
  67. \[
  68. (\comp{g}{f})(n) = f(g(n)) = f(x) = y
  69. \]
  70. and thus $\comp{g}{f}$ is !!{surjective}. We have that $\comp{g}{f}$
  71. is an enumeration of~$B$, and so $B$~is !!{enumerable}.}
  72. {
  73. Then either $A = \emptyset$ or there is !!a{bijection}~$g$ whose
  74. range is $A$ and whose domain is either $\Nat$ or an initial
  75. sequence of natural numbers. If $A = \emptyset$, then $B =
  76. \emptyset$ also (otherwise there would be some~$y \in B$ with no $x
  77. \in A$ such that $g(x) = y$). So suppose we have our
  78. !!{bijection}~$g$. Then $\comp{g}{f}$ is !!a{bijection} with
  79. range~$B$ and domain the same as that of~$g$ (i.e., either $\Nat$ or
  80. an initial segment of it), so that $B$ is !!{enumerable}.}
  81. If $B$ is !!{enumerable}, we obtain that $A$ is !!{enumerable} by
  82. repeating the argument with the !!{bijection} $f^{-1}\colon B \to A$
  83. instead of~$f$.
  84. \end{proof}
  85. \begin{prob}
  86. Show that if $\cardeq{A}{C}$ and $\cardeq{B}{D}$, and $A \cap B =
  87. C \cap D = \emptyset$, then $\cardeq{A \cup B}{C \cup D}$.
  88. \end{prob}
  89. \begin{prob}
  90. Show that if $A$ is infinite and !!{enumerable}, then
  91. $\cardeq{A}{\Nat}$.
  92. \end{prob}
  93. \end{document}

content/sets-functions-relations/size-of-sets/introduction.tex

28 lines; SHA-256 e771bd78d2b9819350b17f333524e22ce44a26647916f5b864cb934e380c1fb9. Open the preserved source file.

  1. % Part:sets-functions-relations
  2. % Chapter: size-of-sets
  3. % Section: introduction
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{sfr}{siz}{int}
  7. \olsection{Introduction}
  8. When Georg Cantor developed set theory in the 1870s, one of his aims
  9. was to make palatable the idea of an infinite collection---an actual
  10. infinity, as the medievals would say. A key part of this was his
  11. treatment of the \emph{size} of different sets. If $a$, $b$ and $c$ are
  12. all distinct, then the set $\{a, b, c\}$ is intuitively \emph{larger}
  13. than $\{a, b\}$. But what about infinite sets? Are they all as large
  14. as each other? It turns out that they are not.
  15. The first important idea here is that of an enumeration. We can
  16. list every finite set by listing all its !!{element}s. For some
  17. infinite sets, we can also list all their !!{element}s if we allow the
  18. list itself to be infinite. Such sets are called !!{enumerable}.
  19. Cantor's surprising result, which we will fully understand by the end
  20. of this chapter, was that some infinite sets are not !!{enumerable}.
  21. \end{document}

content/sets-functions-relations/size-of-sets/non-enumerability-alt.tex

162 lines; SHA-256 0c20a2c420fbf4dbd801bb97e37799b3c602ae33ef2b1dc85ff94e24208ca2bb. Open the preserved source file.

  1. % Part:sets-functions-relations
  2. % Chapter: size-of-sets
  3. % Section: non-enumerability-alt
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{sfr}{siz}{nen-alt}
  7. \olsection{\printtoken{S}{nonenumerable} Sets}
  8. \begin{editorial}
  9. This section proves the non-enumerability of $\Bin^\omega$ and
  10. $\Pow{\Nat}$ using the definitions in \olref[enm-alt]{sec}, i.e.,
  11. requiring a bijection with~$\Nat$ instead of a surjection from
  12. $\PosInt$.
  13. \end{editorial}
  14. \begin{explain}
  15. The set $\Nat$ of natural numbers is infinite. It is also trivially
  16. !!{enumerable}. But the remarkable fact is that there are
  17. \emph{!!{nonenumerable}} sets, i.e., sets which are not !!{enumerable}
  18. (see \olref[sfr][siz][enm-alt]{defn:enumerable}).
  19. This might be surprising. After all, to say that $A$ is
  20. !!{nonenumerable} is to say that there is \emph{no} !!{bijection} $f
  21. \colon \Nat \to A$; that is, no function mapping the infinitely many
  22. !!{element}s of~$\Nat$ to~$A$ exhausts all of~$A$. So if $A$ is
  23. !!{nonenumerable}, there are ``more'' !!{element}s of~$A$ than there
  24. are natural numbers.
  25. To prove that a set is !!{nonenumerable}, you have to show that no
  26. appropriate !!{bijection} can exist. The best way to do this is to
  27. show that every attempt to enumerate !!{element}s of~$A$ must leave at
  28. least one !!{element} out; this shows that no function $f\colon \Nat
  29. \to A$ is !!{surjective}. And a general strategy for establishing this
  30. is to use Cantor's \emph{diagonal method}. Given a list of
  31. !!{element}s of $A$, say, $x_1$, $x_2$, \dots, we construct another
  32. !!{element} of~$A$ which, by its construction, cannot possibly be on
  33. that list.
  34. But all of this is best understood by example. So, our first example
  35. is the set~$\Bin^\omega$ of all infinite strings of $0$'s and $1$'s.
  36. (The `$\Bin$' stands for binary, and we can just think of it as the
  37. two-element set
  38. $\{0,1\}$.)\oliflabeldef{sfr:card-arithmetic:card-opps:sec}{\footnote{More
  39. accurately, we should stipulate that $\Bin^\omega$ is the set of all
  40. $\omega$-sequences of $0$'s and $1$s, i.e., the set
  41. $\funfromto{\omega}{\{0,1\}}$. But the meaning of this will only
  42. become clear in \olref[sfr][card-arithmetic][card-opps]{sec}.}{} This
  43. slightly loose formulation should not cause any confusions
  44. for now, however.}
  45. \end{explain}
  46. \begin{thm}
  47. \ollabel{thm:nonenum-bin-omega}
  48. $\Bin^\omega$~is !!{nonenumerable}.
  49. \end{thm}
  50. \begin{proof}
  51. Consider any enumeration of a subset of $\Bin^\omega$. So we have some
  52. list $s_{0}$, $s_{1}$, $s_{2}$, \dots{} where every $s_n$ is an
  53. infinite string of $0$'s and~$1$'s. Let $s_n(m)$ be the $n$th digit of
  54. the $m$th string in this list. So we can now think of our list as an
  55. array, where $s_n(m)$ is placed at the $n$th row and $m$th column:
  56. \[
  57. \begin{array}{c|c|c|c|c|c}
  58. & 0 & 1 & 2 & 3 & \dots \\\hline
  59. 0 & \mathbf{s_{0}(0)} & s_{0}(1) & s_{0}(2) & s_0(3) & \dots \\\hline
  60. 1 & s_{1}(0)& \mathbf{s_{1}(1)} & s_1(2) & s_1(3) & \dots \\\hline
  61. 2 & s_{2}(0)& s_{2}(1) & \mathbf{s_2(2)} & s_2(3) & \dots \\\hline
  62. 3 & s_{3}(0)& s_{3}(1) & s_3(2) & \mathbf{s_3(3)} & \dots \\\hline
  63. \vdots & \vdots & \vdots & \vdots & \vdots & \mathbf{\ddots}
  64. \end{array}
  65. \]
  66. We will now construct an infinite string, $d$, of $0$'s and $1$'s
  67. which is not on this list. We will do this by specifying each of its
  68. entries, i.e., we specify $d(n)$ for all $n \in \Nat$. Intuitively,
  69. we do this by reading down the diagonal of the array above (hence the
  70. name ``diagonal method'') and then changing every $1$ to a $0$ and
  71. every $1$ to a~$0$. More abstractly, we define $d(n)$ to be $0$ or $1$
  72. according to whether the $n$-th !!{element} of the diagonal, $s_n(n)$,
  73. is $1$ or $0$, that is:
  74. \[
  75. d(n) =
  76. \begin{cases}
  77. 1 & \text{if $s_{n}(n) = 0$}\\
  78. 0 & \text{if $s_{n}(n) = 1$}
  79. \end{cases}
  80. \]
  81. Clearly $d \in \Bin^\omega$, since it is an infinite string of $0$'s
  82. and $1$'s. But we have constructed $d$ so that $d(n) \neq s_n(n)$ for
  83. any $n \in \Nat$. That is, $d$ differs from $s_n$ in its $n$th entry.
  84. So $d \neq s_n$ for any $n\in \Nat$. So $d$ cannot be on the list
  85. $s_0$, $s_1$, $s_2$,
  86. \dots
  87. We have shown, given an arbitrary enumeration of some subset of
  88. $\Bin^\omega$, that it will omit some !!{element} of $\Bin^\omega$. So
  89. there is no enumeration of the set $\Bin^\omega$, i.e., $\Bin^\omega$
  90. is !!{nonenumerable}.
  91. \end{proof}
  92. \begin{explain}
  93. This proof method is called ``diagonalization'' because it uses the
  94. diagonal of the array to define~$d$. However, diagonalization need
  95. not involve the presence of an array. Indeed, we can show that some set is
  96. !!{nonenumerable} by using a similar idea, even when no array and no
  97. actual diagonal is involved. The following result illustrates how.
  98. \end{explain}
  99. \begin{thm}
  100. \ollabel{thm:nonenum-pownat}
  101. $\Pow{\Nat}$ is not !!{enumerable}.
  102. \end{thm}
  103. \begin{proof}
  104. We proceed in the same way, by showing that every list of subsets
  105. of~$\Nat$ omits some subset of $\Nat$. So, suppose that we have some
  106. list $N_0, N_1, N_2, \ldots$ of subsets of $\Nat$. We define a set $D$
  107. as follows: $n \in D$ iff $n \notin N_{n}$:
  108. \[
  109. D = \Setabs{n \in \Nat}{n \notin N_n}
  110. \]
  111. Clearly $D\subseteq \Nat$. But $D$ cannot be on the list. After all,
  112. by construction $n \in D$ iff $n\notin N_n$, so that $D \neq N_n$ for
  113. any $n \in \Nat$.
  114. \end{proof}
  115. \begin{explain}
  116. The preceding proof did not mention a diagonal. Still, you can think
  117. of it as involving a diagonal if you picture it this way: Imagine the
  118. sets $N_0$, $N_1$, \dots, written in an array, where we write $N_n$ on
  119. the $n$th row by writing $m$ in the $m$th column iff if $m \in N_n$.
  120. For example, say the first four sets on that list are
  121. $\{0,1,2,\dots\}$, $\{1, 3, 5, \dots\}$, $\{0,1,4\}$, and
  122. $\{2,3,4,\dots\}$; then our array would begin with
  123. \[
  124. \begin{array}{r@{}rrrrrrr}
  125. N_0 = \{ & \mathbf{0}, & 1, & 2, & & & & \dots\}\\
  126. N_1 = \{ & & \mathbf{1}, & & 3, & & 5, & \dots\}\\
  127. N_2 = \{ & 0, & 1, & & & 4\phantom{,} & & \}\\
  128. N_3 = \{ & & & 2, & \mathbf{3}, & 4, & & \dots\}\\
  129. &\vdots & & & & & & \ddots\phantom{\}}
  130. \end{array}
  131. \]
  132. Then $D$ is the set obtained by going down the diagonal, placing $n
  133. \in D$ iff $n$ is \emph{not} on the diagonal. So in the above case, we
  134. would leave out $0$ and $1$, we would include~$2$, we would leave
  135. out~$3$, etc.
  136. \end{explain}
  137. \begin{prob}
  138. Show that the set of all functions $f \colon \Nat \to \Nat$ is
  139. !!{nonenumerable} by an explicit diagonal argument. That is, show that
  140. if $f_1$, $f_2$, \dots, is a list of functions and each $f_i\colon
  141. \Nat \to \Nat$, then there is some $g \colon \Nat \to
  142. \Nat$ not on this list.
  143. \end{prob}
  144. \end{document}

content/sets-functions-relations/size-of-sets/non-enumerability.tex

214 lines; SHA-256 a272a841f8c50bda6589aac40278b9bff7f8a1f5284730c7195423b09ac3ba2e. Open the preserved source file.

  1. % Part:sets-functions-relations
  2. % Chapter: size-of-sets
  3. % Section: non-enumerability
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{sfr}{siz}{nen}
  7. \olsection{\printtoken{S}{nonenumerable} Sets}
  8. \begin{editorial}
  9. This section proves the non-enumerability of $\Bin^\omega$ and
  10. $\Pow{\PosInt}$ using the definition in \olref[enm]{sec}. It is
  11. designed to be a little more elementary and a little more detailed
  12. than the version in \olref[enm-alt]{sec}
  13. \end{editorial}
  14. Some sets, such as the set $\PosInt$ of positive integers, are
  15. infinite. So far we've seen examples of infinite sets which were all
  16. !!{enumerable}. However, there are also infinite sets which do not
  17. have this property. Such sets are called \emph{!!{nonenumerable}}.
  18. First of all, it is perhaps already surprising that there are
  19. !!{nonenumerable} sets. For any !!{enumerable} set~$A$ there is
  20. !!a{surjective} function $f \colon \PosInt \to A$. If a set is
  21. !!{nonenumerable} there is no such function. That is, no function
  22. mapping the infinitely many !!{element}s of~$\PosInt$ to~$A$ can
  23. exhaust all of~$A$. So there are ``more'' !!{element}s of~$A$ than
  24. the infinitely many positive integers.
  25. How would one prove that a set is !!{nonenumerable}? You have to show
  26. that no such surjective function can exist. Equivalently, you have to
  27. show that the elements of~$A$ cannot be enumerated in a one way
  28. infinite list. The best way to do this is to show that every list of
  29. !!{element}s of~$A$ must leave at least one element out; or that no
  30. function $f\colon \PosInt \to A$ can be !!{surjective}. We can do this
  31. using Cantor's \emph{diagonal method}. Given a list of !!{element}s
  32. of~$A$, say, $x_1$, $x_2$, \dots, we construct another element of~$A$
  33. which, by its construction, cannot possibly be on that list.
  34. Our first example is the set~$\Bin^\omega$ of all infinite, non-gappy
  35. sequences of $0$'s and $1$'s.
  36. \begin{thm}
  37. \ollabel{thm:nonenum-bin-omega}
  38. $\Bin^\omega$~is !!{nonenumerable}.
  39. \end{thm}
  40. \begin{proof}
  41. Suppose, by way of contradiction, that $\Bin^\omega$ is
  42. !!{enumerable}, i.e., suppose that there is a list $s_{1}$, $s_{2}$,
  43. $s_{3}$, $s_{4}$, \dots{} of all !!{element}s of~$\Bin^\omega$. Each
  44. of these $s_i$ is itself an infinite sequence of $0$'s and~$1$'s.
  45. Let's call the $j$-th element of the $i$-th sequence in this list
  46. $s_i(j)$. Then the $i$-th sequence~$s_i$ is
  47. \[
  48. s_i(1), s_i(2), s_i(3), \dots
  49. \]
  50. We may arrange this list, and the elements of each sequence $s_i$ in
  51. it, in an array:
  52. \[
  53. \begin{array}{c|c|c|c|c|c}
  54. & 1 & 2 & 3 & 4 & \dots \\\hline
  55. 1 & \mathbf{s_{1}(1)} & s_{1}(2) & s_{1}(3) & s_1(4) & \dots \\\hline
  56. 2 & s_{2}(1)& \mathbf{s_{2}(2)} & s_2(3) & s_2(4) & \dots \\\hline
  57. 3 & s_{3}(1)& s_{3}(2) & \mathbf{s_3(3)} & s_3(4) & \dots \\\hline
  58. 4 & s_{4}(1)& s_{4}(2) & s_4(3) & \mathbf{s_4(4)} & \dots \\\hline
  59. \vdots & \vdots & \vdots & \vdots & \vdots & \mathbf{\ddots}
  60. \end{array}
  61. \]
  62. The labels down the side give the number of the sequence in the list
  63. $s_1$, $s_2$, \dots; the numbers across the top label the !!{element}s
  64. of the individual sequences. For instance, $s_{1}(1)$ is a name for
  65. whatever number, a $0$ or a~$1$, is the first !!{element} in the
  66. sequence $s_{1}$, and so on.
  67. Now we construct an infinite sequence, $\overline{s}$, of $0$'s and
  68. $1$'s which cannot possibly be on this list. The definition of
  69. $\overline{s}$ will depend on the list $s_1$, $s_2$, \dots. Any
  70. infinite list of infinite sequences of $0$'s and $1$'s gives rise to
  71. an infinite sequence~$\overline{s}$ which is guaranteed to not appear
  72. on the list.
  73. To define $\overline{s}$, we specify what all its !!{element}s are,
  74. i.e., we specify $\overline{s}(n)$ for all $n \in \PosInt$. We do this
  75. by reading down the diagonal of the array above (hence the name
  76. ``diagonal method'') and then changing every $1$ to a $0$ and every
  77. $0$ to a~$1$. More abstractly, we define $\overline{s}(n)$ to be $0$
  78. or $1$ according to whether the $n$-th !!{element} of the diagonal,
  79. $s_n(n)$, is $1$ or $0$.
  80. \[
  81. \overline{s}(n) =
  82. \begin{cases}
  83. 1 & \text{if $s_{n}(n) = 0$}\\
  84. 0 & \text{if $s_{n}(n) = 1$}.
  85. \end{cases}
  86. \]
  87. If you like formulas better than definitions by cases, you could also
  88. define $\overline{s}(n) = 1 - s_n(n)$.
  89. Clearly $\overline{s}$ is an infinite sequence of $0$'s and
  90. $1$'s, since it is just the mirror sequence to the sequence of $0$'s
  91. and $1$'s that appear on the diagonal of our array. So $\overline{s}$
  92. is !!a{element} of~$\Bin^\omega$. But it cannot be on the list $s_1$,
  93. $s_2$, \dots{} Why not?
  94. It can't be the first sequence in the list, $s_1$, because it differs from
  95. $s_1$ in the first !!{element}. Whatever $s_1(1)$ is, we defined
  96. $\overline{s}(1)$ to be the opposite. It can't be the second
  97. sequence in the list, because $\overline{s}$ differs from $s_2$ in the second
  98. element: if $s_2(2)$ is $0$, $\overline{s}(2)$ is $1$, and vice
  99. versa. And so on.
  100. More precisely: if $\overline{s}$ were on the list, there would be
  101. some $k$ so that $\overline{s} = s_{k}$. Two sequences are identical
  102. iff they agree at every place, i.e., for any~$n$, $\overline{s}(n) =
  103. s_{k}(n)$. So in particular, taking $n = k$ as a special case,
  104. $\overline{s}(k) = s_{k}(k)$ would have to hold. $s_k(k)$ is either
  105. $0$ or~$1$. If it is $0$ then $\overline{s}(k)$ must be~$1$---that's
  106. how we defined $\overline{s}$. But if $s_k(k) = 1$ then, again because
  107. of the way we defined $\overline{s}$, $\overline{s}(k) = 0$. In either
  108. case $\overline{s}(k) \neq s_{k}(k)$.
  109. We started by assuming that there is a list of !!{element}s of
  110. $\Bin^\omega$, $s_1$, $s_2$, \dots{} From this list we constructed a
  111. sequence~$\overline{s}$ which we proved cannot be on the list. But it
  112. definitely is a sequence of $0$'s and $1$'s if all the $s_i$ are
  113. sequences of $0$'s and $1$'s, i.e., $\overline{s} \in
  114. \Bin^\omega$. This shows in particular that there can be no list of
  115. \emph{all} !!{element}s of~$\Bin^\omega$, since for any such list we
  116. could also construct a sequence~$\overline{s}$ guaranteed to not be on
  117. the list, so the assumption that there is a list of all sequences
  118. in~$\Bin^\omega$ leads to a contradiction.
  119. \end{proof}
  120. \begin{explain}
  121. This proof method is called ``diagonalization'' because it uses the
  122. diagonal of the array to define~$\overline{s}$. Diagonalization need
  123. not involve the presence of an array: we can show that sets are not
  124. !!{enumerable} by using a similar idea even when no array and no
  125. actual diagonal is involved.
  126. \end{explain}
  127. \begin{thm}
  128. \ollabel{thm:nonenum-pownat}
  129. $\Pow{\PosInt}$ is not !!{enumerable}.
  130. \end{thm}
  131. \begin{proof}
  132. We proceed in the same way, by showing that for every list of subsets
  133. of~$\PosInt$ there is a subset of $\PosInt$ which cannot be on the list.
  134. Suppose the following is a given list of subsets of~$\PosInt$:
  135. \[
  136. Z_{1}, Z_{2}, Z_{3}, \dots
  137. \]
  138. We now define a set $\overline{Z}$ such that for any $n \in \PosInt$,
  139. $n \in \overline{Z}$ iff $n \notin Z_{n}$:
  140. \[
  141. \overline{Z} = \Setabs{n \in \PosInt}{n \notin Z_n}
  142. \]
  143. $\overline{Z}$ is clearly a set of positive integers, since by
  144. assumption each~$Z_n$ is, and thus $\overline{Z} \in
  145. \Pow{\PosInt}$. But $\overline{Z}$ cannot be on the list. To show
  146. this, we'll establish that for each $k \in \PosInt$, $\overline{Z} \neq
  147. Z_k$.
  148. So let $k \in \PosInt$ be arbitrary. We've defined $\overline{Z}$ so
  149. that for any $n \in \PosInt$, $n \in \overline{Z}$ iff $n \notin Z_n$.
  150. In particular, taking $n=k$, $k \in \overline{Z}$ iff $k \notin Z_k$.
  151. But this shows that $\overline{Z} \neq Z_k$, since $k$ is !!a{element}
  152. of one but not the other, and so $\overline{Z}$ and $Z_k$ have
  153. different !!{element}s. Since $k$ was arbitrary, $\overline{Z}$ is not
  154. on the list $Z_1$, $Z_2$, \dots
  155. \end{proof}
  156. \begin{explain}
  157. The preceding proof did not mention a diagonal, but you can think of
  158. it as involving a diagonal if you picture it this way: Imagine the
  159. sets $Z_1$, $Z_2$, \dots, written in an array, where each
  160. !!{element}~$j \in Z_i$ is listed in the~$j$-th column. Say the first
  161. four sets on that list are $\{1,2,3,\dots\}$, $\{2, 4, 6, \dots\}$,
  162. $\{1,2,5\}$, and $\{3,4,5,\dots\}$. Then the array would begin with
  163. \[
  164. \begin{array}{r@{}rrrrrrr}
  165. Z_1 = \{ & \mathbf{1}, & 2, & 3, & 4, & 5, & 6, & \dots\}\\
  166. Z_2 = \{ & & \mathbf{2}, & & 4, & & 6, & \dots\}\\
  167. Z_3 = \{ & 1, & 2, & & & 5\phantom{,} & & \}\\
  168. Z_4 = \{ & & & 3, & \mathbf{4}, & 5, & 6, & \dots\}\\
  169. \vdots & & & & & \ddots
  170. \end{array}
  171. \]
  172. Then $\overline{Z}$ is the set obtained by going down the diagonal,
  173. leaving out any numbers that appear along the diagonal and include
  174. those $j$ where the array has a gap in the $j$-th row/column. In the
  175. above case, we would leave out $1$ and $2$, include~$3$, leave
  176. out~$4$, etc.
  177. \end{explain}
  178. \begin{prob}
  179. Show that $\Pow{\Nat}$ is !!{nonenumerable} by a diagonal argument.
  180. \end{prob}
  181. \begin{prob}\label{sfr:siz:nen:prob:f-posint}
  182. Show that the set of functions $f \colon \PosInt \to \PosInt$ is
  183. !!{nonenumerable} by an explicit diagonal argument. That is, show that
  184. if $f_1$, $f_2$, \dots, is a list of functions and each $f_i\colon
  185. \PosInt \to \PosInt$, then there is some $\overline{f}\colon \PosInt \to
  186. \PosInt$ not on this list.
  187. \end{prob}
  188. \end{document}

content/sets-functions-relations/size-of-sets/pairing-alt.tex

114 lines; SHA-256 fd523f5306e1fd0e5c03f4c572d244fb017d1c0be27939f180bc6867a214e425. Open the preserved source file.

  1. % Part:sets-functions-relations
  2. % Chapter: size-of-sets
  3. % Section: pairing-alt
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{sfr}{siz}{pai-alt}
  7. \olsection{An Alternative Pairing Function}
  8. \begin{explain}
  9. There are other enumerations of $\Nat^2$ that make it easier to
  10. figure out what their inverses are. Here is one. Instead of
  11. visualizing the enumeration in an array, start with the list of
  12. positive integers associated with (initially) empty spaces. Imagine
  13. filling these spaces successively with pairs $\tuple{n,m}$ as follows.
  14. Starting with the pairs that have~$0$ in the first place (i.e., pairs
  15. $\tuple{0,m}$), put the first (i.e., $\tuple{0,0}$) in the first empty
  16. place, then skip an empty space, put the second (i.e., $\tuple{0,2}$)
  17. in the next empty place, skip one again, and so forth. The
  18. (incomplete) beginning of our enumeration now looks like this
  19. \[\small
  20. \begin{array}{@{}c c c c c c c c c c c@{}}
  21. \mathbf 1 & \mathbf 2 & \mathbf 3 & \mathbf 4 & \mathbf 5 & \mathbf 6 & \mathbf 7 & \mathbf 8 & \mathbf 9 & \mathbf{10} & \dots \\ \\
  22. \tuple{0,0} & & \tuple{0,1} & & \tuple{0,2} & & \tuple{0,3} & & \tuple{0,4} & & \dots \\
  23. \end{array}
  24. \]
  25. Repeat this with pairs $\tuple{1,m}$ for the place that still remain
  26. empty, again skipping every other empty place:
  27. \[\small
  28. \begin{array}{@{}c c c c c c c c c c c@{}}
  29. \mathbf 1 & \mathbf 2 & \mathbf 3 & \mathbf 4 & \mathbf 5 & \mathbf 6 & \mathbf 7 & \mathbf 8 & \mathbf 9 & \mathbf{10} & \dots \\ \\
  30. \tuple{0,0} & \tuple{1,0} & \tuple{0,1} & & \tuple{0,2} & \tuple{1,1} &
  31. \tuple{0,3} & & \tuple{0,4} & \tuple{1,2} & \dots \\
  32. \end{array}
  33. \]
  34. Enter pairs $\tuple{2,m}$, $\tuple{2,m}$, etc., in the same way. Our
  35. completed enumeration thus starts like this:
  36. \[\small
  37. \begin{array}{@{}cc c c c c c c c c c@{}}
  38. \mathbf 1 & \mathbf 2 & \mathbf 3 & \mathbf 4 & \mathbf 5 & \mathbf 6 & \mathbf 7 & \mathbf 8 & \mathbf 9 & \mathbf{10} & \dots \\ \\
  39. \tuple{0,0} & \tuple{1,0} & \tuple{0,1} & \tuple{2,0} & \tuple{0,2} &
  40. \tuple{1,1} & \tuple{0,3} & \tuple{3,0} & \tuple{0,4} & \tuple{1,2} & \dots \\
  41. \end{array}
  42. \]
  43. If we number the cells in the array above according to this
  44. enumeration, we will not find a neat zig-zag line, but this
  45. arrangement:
  46. \[
  47. \begin{array}{ c | c | c | c | c | c | c | c }
  48. & \mathbf 0 & \mathbf 1 & \mathbf 2 & \mathbf 3 & \mathbf 4 & \mathbf 5 & \dots \\
  49. \hline
  50. \mathbf 0 & 1 & 3 & 5 & 7 & 9 & 11 & \dots \\
  51. \hline
  52. \mathbf 1 & 2 & 6 & 10 & 14 & 18 & \dots & \dots \\
  53. \hline
  54. \mathbf 2 & 4 & 12 & 20 & 28 & \dots & \dots & \dots \\
  55. \hline
  56. \mathbf 3 & 8 & 24 & 40 & \dots & \dots & \dots & \dots \\
  57. \hline
  58. \mathbf 4 & 16 & 48 & \dots & \dots & \dots & \dots & \dots \\
  59. \hline
  60. \mathbf 5 & 32 & \dots & \dots & \dots & \dots & \dots & \dots \\
  61. \hline
  62. \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \ddots\\
  63. \end{array}
  64. \]
  65. We can see that the pairs in row~$0$ are in the odd numbered places of
  66. our enumeration, i.e., pair $\tuple{0,m}$ is in place $2m+1$; pairs in
  67. the second row, $\tuple{1,m}$, are in places whose number is the
  68. double of an odd number, specifically, $2 \cdot (2m+1)$; pairs in the
  69. third row, $\tuple{2,m}$, are in places whose number is four times an
  70. odd number, $4 \cdot (2m+1)$; and so on. The factors of $(2m+1)$ for
  71. each row, $1$, $2$, $4$, $8$, \dots, are exactly the powers of~$2$:
  72. $1= 2^0$, $2 = 2^1$, $4 = 2^2$, $8 = 2^3$, \dots\@ In fact, the
  73. relevant exponent is always the first member of the pair in
  74. question. Thus, for pair $\tuple{n,m}$ the factor is $2^n$. This
  75. gives us the general formula: $2^n \cdot (2m+1)$. However, this is a
  76. mapping of pairs to \emph{positive} integers, i.e., $\tuple{0,0}$ has
  77. position~$1$. If we want to begin at position~$0$ we must subtract~$1$
  78. from the result. This gives us:
  79. \end{explain}
  80. \begin{ex}
  81. The function $h\colon \Nat^2 \to \Nat$ given by
  82. \[
  83. h(n,m) = 2^n (2m+1) - 1
  84. \]
  85. is a pairing function for the set of pairs of natural numbers~$\Nat^2$.
  86. \end{ex}
  87. \begin{explain}
  88. Accordingly, in our second enumeration of $\Nat^2$, the pair
  89. $\tuple{0,0}$ has code $h(0,0) = 2^0(2\cdot 0+1) - 1 = 0$;
  90. $\tuple{1,2}$ has code $2^{1} \cdot (2 \cdot 2 + 1) - 1 = 2
  91. \cdot 5 - 1 = 9$; $\tuple{2,6}$ has code $2^{2} \cdot (2
  92. \cdot 6 + 1) - 1 = 51$.
  93. \end{explain}
  94. Sometimes it is enough to encode pairs of natural numbers~$\Nat^2$
  95. without requiring that the encoding is surjective. Such encodings have
  96. inverses that are only partial functions.
  97. \begin{ex}
  98. The function $j\colon \Nat^2 \to \Nat^+$ given by
  99. \[
  100. j(n,m) = 2^n3^m
  101. \]
  102. is !!a{injective} function $\Nat^2 \to \Nat$.
  103. \end{ex}
  104. \end{document}

content/sets-functions-relations/size-of-sets/pairing.tex

115 lines; SHA-256 345a39184e28af727e378d5b5883b5e7d2e1c27cd729329376d19426ddaed484. Open the preserved source file.

  1. % Part:sets-functions-relations
  2. % Chapter: size-of-sets
  3. % Section: pairing
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{sfr}{siz}{pai}
  7. \olsection{Pairing Functions and Codes}
  8. \begin{explain}
  9. Cantor's zig-zag method makes the enumerability of $\Nat^n$ visually
  10. evident. But let us focus on our array depicting $\Nat^2$. Following
  11. the zig-zag line in the array and counting the places, we can check
  12. that $\tuple{1,2}$ is associated with the number~$7$. However, it would
  13. be nice if we could compute this more directly. That is, it would be
  14. nice to have to hand the \emph{inverse} of the zig-zag enumeration,
  15. $g\colon \Nat^2 \to \Nat$, such that
  16. \[
  17. g(\tuple{0,0}) = 0, \;
  18. g(\tuple{0,1}) = 1, \;
  19. g(\tuple{1,0}) = 2, \; \dots,
  20. g(\tuple{1,2}) = 7, \; \dots
  21. \]
  22. This would enable us to calculate exactly where $\tuple{n, m}$ will occur
  23. in our enumeration.
  24. In fact, we can define $g$ directly by making two observations. First:
  25. if the $n$th row and $m$th column contains value~$v$, then the
  26. $(n+1)$st row and $(m-1)$st column contains value $v + 1$. Second: the
  27. first row of our enumeration consists of the triangular numbers,
  28. starting with $0$, $1$, $3$, $6$, etc. The $k$th triangular number is
  29. the sum of the natural numbers $< k$, which can be computed as
  30. $k(k+1)/2$. Putting these two observations together, consider this
  31. function:
  32. \[
  33. g(n,m) = \frac{(n+m+1)(n+m)}{2} + n
  34. \]
  35. We often just write $g(n, m)$ rather that $g(\tuple{n, m})$, since it
  36. is easier on the eyes. This tells you first to determine the
  37. $(n+m)^\text{th}$ triangle number, and then add $n$ to it. And
  38. it populates the array in exactly the way we would like. So in
  39. particular, the pair $\tuple{1, 2}$ is sent to $\frac{4 \times 3}{2} +
  40. 1 = 7$.
  41. This function $g$ is the \emph{inverse} of an enumeration of a set of
  42. pairs. Such functions are called \emph{pairing functions}.
  43. \end{explain}
  44. \begin{defn}[Pairing function]
  45. A function $f\colon A \times B \to \Nat$ is an arithmetical
  46. \emph{pairing function} if $f$ is injective. We also say that $f$
  47. \emph{encodes} $A \times B$, and that $f(x,y)$ is the
  48. \emph{code} for $\tuple{x,y}$.
  49. \end{defn}
  50. \begin{explain}
  51. We can use pairing functions to encode, e.g., pairs of natural numbers;
  52. or, in other words, we can represent each \emph{pair} of elements
  53. using a \emph{single} number. Using the inverse of the pairing
  54. function, we can \emph{decode} the number, i.e., find out which
  55. pair it represents.
  56. \end{explain}
  57. \begin{prob}
  58. Give an enumeration of the set of all non-negative rational numbers.
  59. \end{prob}
  60. \begin{prob}
  61. Show that $\Rat$ is !!{enumerable}. Recall that any rational number
  62. can be written as a fraction $z/m$ with $z \in \Int$, $m \in \Nat^+$.
  63. \end{prob}
  64. \begin{prob}
  65. Define an enumeration of $\Bin^*$.
  66. \end{prob}
  67. \begin{prob}
  68. Recall from your introductory logic course that each possible truth
  69. table expresses a truth function. In other words, the truth functions
  70. are all functions from $\Bin^k \to \Bin$ for some~$k$. Prove that the
  71. set of all truth functions is enumerable.
  72. \end{prob}
  73. \begin{prob}
  74. Show that the set of all finite subsets of an arbitrary infinite
  75. !!{enumerable} set is !!{enumerable}.
  76. \end{prob}
  77. \begin{prob}
  78. A subset of $\Nat$ is said to be \emph{cofinite} iff it is the
  79. complement of a finite set $\Nat$; that is, $A \subseteq \Nat$ is
  80. cofinite iff $\Nat\setminus A$ is finite. Let $I$ be the set whose
  81. !!{element}s are exactly the finite and cofinite subsets of $\Nat$.
  82. Show that $I$ is !!{enumerable}.
  83. \end{prob}
  84. \begin{prob}
  85. Show that the !!{enumerable} union of !!{enumerable} sets is
  86. !!{enumerable}. That is, whenever $A_1$, $A_2$, \dots{} are sets, and
  87. each $A_i$ is !!{enumerable}, then the union $\bigcup_{i=1}^\infty
  88. A_i$ of all of them is also !!{enumerable}. [NB: this is hard!]
  89. \end{prob}
  90. \begin{prob}
  91. Let $f \colon A \times B \to \Nat$ be an arbitrary pairing function.
  92. Show that the inverse of $f$ is an enumeration of $A \times B$.
  93. \end{prob}
  94. \begin{prob}
  95. Specify a function that encodes $\Nat^3$.
  96. \end{prob}
  97. \end{document}

content/sets-functions-relations/size-of-sets/reduction-alt.tex

140 lines; SHA-256 46381b85c0e9a1ab48cb9301518de91f073d649c3b1119325c1409f5a6c1d663. Open the preserved source file.

  1. % Part:sets-functions-relations
  2. % Chapter: size-of-sets
  3. % Section: reduction-alt
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{sfr}{siz}{red-alt}
  7. \olsection{Reduction}
  8. \begin{editorial}
  9. This section proves non-enumerability by reduction, matching the
  10. results in \olref[nen-alt]{sec}. An alternative, slightly more
  11. elaborate version matching the results in \olref[nen]{sec} is
  12. provided in \olref[red]{sec}.
  13. \end{editorial}
  14. We proved that $\Bin^\omega$ is !!{nonenumerable} by a diagonalization
  15. argument. We used a similar diagonalization argument to show that
  16. $\Pow{\Nat}$ is !!{nonenumerable}. But here's another way we can prove
  17. that $\Pow{\Nat}$ is !!{nonenumerable}: show that \emph{if
  18. $\Pow{\Nat}$ is !!{enumerable} then $\Bin^\omega$ is also
  19. !!{enumerable}}. Since we know $\Bin^\omega$ is !!{nonenumerable}, it
  20. will follow that $\Pow{\Nat}$ is too.
  21. This is called \emph{reducing} one problem to another. In this case,
  22. we reduce the problem of enumerating $\Bin^\omega$ to the problem of
  23. enumerating $\Pow{\Nat}$. A solution to the latter---an enumeration
  24. of $\Pow{\Nat}$---would yield a solution to the former---an
  25. enumeration of $\Bin^\omega$.
  26. To reduce the problem of enumerating a set~$B$ to that of enumerating
  27. a set~$A$, we provide a way of turning an enumeration of~$A$ into an
  28. enumeration of~$B$. The easiest way to do that is to define
  29. !!a{surjection} $f\colon A \to B$. If $x_1$, $x_2$, \dots{}
  30. enumerates~$A$, then $f(x_1)$, $f(x_2)$, \dots{} would enumerate~$B$.
  31. In our case, we are looking for !!a{surjection} $f\colon \Pow{\Nat}
  32. \to \Bin^\omega$.
  33. \begin{prob}
  34. Show that if there is an !!{injective} function $g\colon B \to A$, and
  35. $B$~is !!{nonenumerable}, then so is~$A$. Do this by showing how you
  36. can use~$g$ to turn an enumeration of~$A$ into one of~$B$.
  37. \end{prob}
  38. \begin{proof}[Proof of {\olref[nen-alt]{thm:nonenum-pownat}} by reduction]
  39. For a reduction, suppose that $\Pow{\Nat}$ is !!{enumerable}, and thus that
  40. there is an enumeration of it, $N_{1}$, $N_{2}$, $N_{3}$, \dots
  41. Define the function $f \colon \Pow{\Nat} \to \Bin^\omega$ by letting
  42. $f(N)$ be the string $s_{k}$ such that $s_{k}(n) = 1$ iff $n \in N$,
  43. and $s_k(n) = 0$ otherwise.
  44. This clearly defines a function, since whenever $N \subseteq \Nat$,
  45. any $n \in \Nat$ either is !!a{element} of $N$ or isn't. For
  46. instance, the set $2\Nat = \Setabs{2n}{n \in \Nat} = \{0,2, 4, 6,
  47. \dots\}$ of even naturals gets mapped to the string $1010101\dots$;
  48. $\emptyset$ gets mapped to $0000\dots$; $\Nat$ gets mapped to
  49. $1111\dots$.
  50. It is also !!{surjective}: every string of $0$s and $1$s corresponds
  51. to some set of natural numbers, namely the one which has as its
  52. members those natural numbers corresponding to the places where the string
  53. contains a~$1$s. More precisely, if $s \in \Bin^\omega$, then define $N
  54. \subseteq \Nat$ by:
  55. \[
  56. N = \Setabs{n \in \Nat}{s(n) = 1}
  57. \]
  58. Then $f(N) = s$, as can be verified by consulting the definition
  59. of~$f$.
  60. Now consider the list
  61. \[
  62. f(N_1), f(N_2), f(N_3), \dots
  63. \]
  64. Since $f$ is !!{surjective}, every member of $\Bin^\omega$ must
  65. appear as a value of~$f$ for some argument, and so must appear on the
  66. list. This list must therefore enumerate all of~$\Bin^\omega$.
  67. So if $\Pow{\Nat}$ were !!{enumerable}, $\Bin^\omega$ would be
  68. !!{enumerable}. But $\Bin^\omega$ is !!{nonenumerable}
  69. (\olref[nen-alt]{thm:nonenum-bin-omega}). Hence $\Pow{\Nat}$ is
  70. !!{nonenumerable}.
  71. \end{proof}
  72. %\begin{explain}
  73. %It is easy to be confused about the direction the reduction goes in.
  74. %For instance, !!a{surjective} function $g \colon \Bin^\omega \to X$
  75. %does \emph{not} establish that $X$ is !!{nonenumerable}. (Consider $g
  76. %\colon \Bin^\omega \to \Bin$ defined by $g(s) = s(1)$, the function
  77. %that maps a sequence of $0$'s and $1$'s to its first !!{element}. It
  78. %is surjective, because some sequences start with $0$ and some start
  79. %with $1$. But $\Bin$ is finite.) Note also that the function $f$ must
  80. %be surjective, or otherwise the argument does not go through:
  81. %$f(x_1)$, $f(x_2)$, \dots{} would then not be guaranteed to include
  82. %all the !!{element}s of~$Y$. For instance, $h\colon \Nat \to
  83. %\Bin^\omega$ defined by
  84. %\[
  85. %h(n) = \underbrace{000\dots0}_{\text{$n$ $0$'s}}
  86. %\]
  87. %is a function, but $\Nat$ is !!{enumerable}.
  88. %\end{explain}
  89. \begin{prob}\label{sfr:siz:red:prob:nat-nat}
  90. Show that the set~$X$ of all functions $f\colon \Nat \to \Nat$ is
  91. !!{nonenumerable} by a reduction argument (Hint: give a surjective
  92. function from $X$ to~$\Bin^\omega$.)
  93. \end{prob}
  94. \begin{prob}
  95. Show that the set of all \emph{sets of} pairs of natural numbers,
  96. i.e., $\Pow{\Nat \times \Nat}$, is !!{nonenumerable} by a reduction
  97. argument.
  98. \end{prob}
  99. \begin{prob}
  100. Show that $\Nat^\omega$, the set of infinite sequences of natural
  101. numbers, is !!{nonenumerable} by a reduction argument.
  102. \end{prob}
  103. %\begin{prob}
  104. %Let $P$ be the set of functions from $\Nat$ to the set $\{0\}$, and let $Q$ be the set of \emph{partial}
  105. %functions from the set of positive integers to the set $\{0\}$. Show
  106. %that $P$~is !!{enumerable} and $Q$~is not. (Hint: reduce the problem
  107. %of enumerating $\Bin^\omega$ to enumerating~$Q$).
  108. %\end{prob}
  109. \begin{prob}
  110. Let $S$ be the set of all !!{surjection}s from $\Nat$ to the set
  111. $\{0,1\}$, i.e., $S$ consists of all !!{surjection}s~$f \colon \Nat
  112. \to \Bin$. Show that $S$ is !!{nonenumerable}.
  113. \end{prob}
  114. \begin{prob}
  115. Show that the set~$\Real$ of all real numbers is !!{nonenumerable}.
  116. \end{prob}
  117. \end{document}

content/sets-functions-relations/size-of-sets/reduction.tex

138 lines; SHA-256 33f0cbb35c8c1fa3ff0e4f44fa626fdc298d1c4612aeaafb41bcb920e5d18ac8. Open the preserved source file.

  1. % Part:sets-functions-relations
  2. % Chapter: sets
  3. % Section: reduction
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{sfr}{siz}{red}
  7. \olsection{Reduction}
  8. \begin{editorial}
  9. This section proves non-enumerability by reduction, matching the
  10. results in \olref[nen]{sec}. An alternative, slightly more condensed
  11. version matching the results in \olref[nen-alt]{sec} is provided in
  12. \olref[red-alt]{sec}.
  13. \end{editorial}
  14. We showed $\Pow{\PosInt}$ to be !!{nonenumerable} by a diagonalization
  15. argument. We already had a proof that $\Bin^\omega$, the set of all
  16. infinite sequences of $0$s and $1$s, is !!{nonenumerable}. Here's
  17. another way we can prove that $\Pow{\PosInt}$ is !!{nonenumerable}:
  18. Show that \emph{if $\Pow{\PosInt}$ is !!{enumerable} then $\Bin^\omega$
  19. is also !!{enumerable}}. Since we know $\Bin^\omega$ is not
  20. !!{enumerable}, $\Pow{\PosInt}$ can't be either. This is called
  21. \emph{reducing} one problem to another---in this case, we reduce the
  22. problem of enumerating $\Bin^\omega$ to the problem of enumerating
  23. $\Pow{\PosInt}$. A solution to the latter---an enumeration of
  24. $\Pow{\PosInt}$---would yield a solution to the former---an enumeration
  25. of $\Bin^\omega$.
  26. How do we reduce the problem of enumerating a set~$B$ to that of
  27. enumerating a set~$A$? We provide a way of turning an enumeration
  28. of~$A$ into an enumeration of~$B$. The easiest way to do that is to
  29. define !!a{surjective} function $f\colon A \to B$. If $x_1$, $x_2$,
  30. \dots{} enumerates~$A$, then $f(x_1)$, $f(x_2)$, \dots{} would
  31. enumerate~$B$. In our case, we are looking for a surjective
  32. function $f\colon \Pow{\PosInt} \to \Bin^\omega$.
  33. \begin{prob}
  34. Show that if there is an !!{injective} function $g\colon B \to A$, and
  35. $B$~is !!{nonenumerable}, then so is~$A$. Do this by showing how you
  36. can use~$g$ to turn an enumeration of~$A$ into one of~$B$.
  37. \end{prob}
  38. \begin{proof}[Proof of {\olref[nen]{thm:nonenum-pownat}} by reduction]
  39. Suppose that $\Pow{\PosInt}$ were !!{enumerable}, and thus that
  40. there is an enumeration of it, $Z_{1}$, $Z_{2}$, $Z_{3}$, \dots
  41. Define the function $f \colon \Pow{\PosInt} \to \Bin^\omega$ by letting
  42. $f(Z)$ be the sequence $s_{k}$ such that $s_{k}(n) = 1$ iff $n \in Z$,
  43. and $s_k(n) = 0$ otherwise. This clearly defines a function, since
  44. whenever $Z \subseteq \PosInt$, any $n \in \PosInt$ either is
  45. !!a{element} of $Z$ or isn't. For instance, the set $2\PosInt = \{2,
  46. 4, 6, \dots\}$ of positive even numbers gets mapped to the sequence
  47. $010101\dots$, the empty set gets mapped to $0000\dots$ and the set
  48. $\PosInt$ itself to $1111\dots$.
  49. It also is !!{surjective}: Every sequence of $0$s and $1$s corresponds
  50. to some set of positive integers, namely the one which has as its
  51. members those integers corresponding to the places where the sequence
  52. has~$1$s. More precisely, suppose $s \in \Bin^\omega$. Define $Z
  53. \subseteq \PosInt$ by:
  54. \[
  55. Z = \Setabs{n \in \PosInt}{s(n) = 1}
  56. \]
  57. Then $f(Z) = s$, as can be verified by consulting the definition
  58. of~$f$.
  59. Now consider the list
  60. \[
  61. f(Z_1), f(Z_2), f(Z_3), \dots
  62. \]
  63. Since $f$ is !!{surjective}, every member of $\Bin^\omega$ must
  64. appear as a value of~$f$ for some argument, and so must appear on the
  65. list. This list must therefore enumerate all of~$\Bin^\omega$.
  66. So if $\Pow{\PosInt}$ were !!{enumerable}, $\Bin^\omega$ would be
  67. !!{enumerable}. But $\Bin^\omega$ is !!{nonenumerable}
  68. (\olref[nen]{thm:nonenum-bin-omega}). Hence $\Pow{\PosInt}$ is
  69. !!{nonenumerable}.
  70. \end{proof}
  71. \begin{explain}
  72. It is easy to be confused about the direction the reduction goes in.
  73. For instance, !!a{surjective} function $g \colon \Bin^\omega \to B$
  74. does \emph{not} establish that $B$ is !!{nonenumerable}. (Consider $g
  75. \colon \Bin^\omega \to \Bin$ defined by $g(s) = s(1)$, the function
  76. that maps a sequence of $0$'s and $1$'s to its first !!{element}. It
  77. is !!{surjective}, because some sequences start with $0$ and some start
  78. with $1$. But $\Bin$ is finite.) Note also that the function~$f$ must
  79. be !!{surjective}, or otherwise the argument does not go through:
  80. $f(x_1)$, $f(x_2)$, \dots{} would then not be guaranteed to include
  81. all the !!{element}s of~$B$. For instance,
  82. \[
  83. h(n) = \underbrace{000\dots0}_{\text{$n$ $0$'s}}
  84. \]
  85. defines a function $h\colon \PosInt \to
  86. \Bin^\omega$, but $\PosInt$ is !!{enumerable}.
  87. \end{explain}
  88. \begin{prob}
  89. Show that the set of all \emph{sets of} pairs of positive integers is
  90. !!{nonenumerable} by a reduction argument.
  91. \end{prob}
  92. \begin{prob}\label{sfr:siz:red:prob:nat-nat}
  93. Show that the set~$X$ of all functions $f\colon \Nat \to \Nat$ is
  94. !!{nonenumerable} by a reduction argument (Hint: give a surjective
  95. function from $X$ to~$\Bin^\omega$.)
  96. \end{prob}
  97. \begin{prob}
  98. Show that $\Nat^\omega$, the set of infinite sequences of
  99. natural numbers, is !!{nonenumerable} by a reduction argument.
  100. \end{prob}
  101. \begin{prob}
  102. Let $P$ be the set of functions from the set of positive
  103. integers to the set $\{0\}$, and let $Q$ be the set of \emph{partial}
  104. functions from the set of positive integers to the set $\{0\}$. Show
  105. that $P$~is !!{enumerable} and $Q$~is not. (Hint: reduce the problem
  106. of enumerating $\Bin^\omega$ to enumerating~$Q$).
  107. \end{prob}
  108. \begin{prob}
  109. Let $S$ be the set of all !!{surjective} functions from the set of
  110. positive integers to the set \{0,1\}, i.e., $S$ consists of all
  111. !!{surjective}~$f\colon \PosInt \to \Bin$. Show that $S$ is
  112. !!{nonenumerable}.
  113. \end{prob}
  114. \begin{prob}
  115. Show that the set~$\Real$ of all real numbers is !!{nonenumerable}.
  116. \end{prob}
  117. \end{document}

content/sets-functions-relations/size-of-sets/schroder-bernstein.tex

53 lines; SHA-256 7b99b3e032e24e425383734ce80ad9a5cc37d018c09205e02f37b927d50bb56a. Open the preserved source file.

  1. % Part:sets-functions-relations
  2. % Chapter: sets
  3. % Section: schroder-bernstein
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{sfr}{siz}{sb}
  7. \olsection{The Notion of Size, and Schr\"oder-Bernstein}
  8. \begin{explain}
  9. Here is an intuitive thought: if $A$ is no larger than $B$ and $B$ is
  10. no larger than $A$, then $A$ and $B$ are equinumerous. To be honest,
  11. if this thought were \emph{wrong}, then we could scarcely justify the
  12. thought that our defined notion of equinumerosity has anything to do
  13. with comparisons of ``sizes'' between sets!{} Fortunately, though,
  14. the intuitive thought is correct. This is justified by the
  15. Schr\"oder-Bernstein Theorem.
  16. \end{explain}
  17. \begin{thm}[Schr\"oder-Bernstein]
  18. \ollabel{thm:schroder-bernstein}
  19. If $\cardle{A}{B}$ and $\cardle{B}{A}$,
  20. then $\cardeq{A}{B}$.
  21. \end{thm}
  22. \begin{explain}
  23. In other words, if there is !!a{injection} from $A$ to~$B$, and
  24. !!a{injection} from $B$ to~$A$, then there is !!a{bijection} from $A$
  25. to~$B$.
  26. This result, however, is really rather \emph{difficult} to prove.
  27. Indeed, although Cantor stated the result, others proved
  28. it.\footnote{For more on the history, see e.g.,
  29. \citet[pp.~165--6]{Potter2004}.}
  30. \oliflabeldef{sfr:cardinals:card-sb:sec}{We will only be in
  31. a position to \emph{prove} Schr\"oder-Bernstein in
  32. \olref[sfr][cardinals][card-sb]{sec}.}{}%
  33. For now, you can (and must)
  34. take it on trust.
  35. Fortunately, Schr\"oder-Bernstein is \emph{correct}, and it
  36. vindicates our thinking of the relations we defined, i.e.,
  37. $\cardeq{A}{B}$ and $\cardle{A}{B}$, as having something to do with
  38. ``size''. Moreover, Schr\"oder-Bernstein is very \emph{useful}. It
  39. can be difficult to think of !!a{bijection} between two equinumerous
  40. sets. The Schr\"oder-Bernstein Theorem allows us to break the comparison
  41. down into cases so we only have to think of !!a{injection} from the
  42. first to the second, and vice-versa.
  43. \end{explain}
  44. \end{document}

content/sets-functions-relations/size-of-sets/size-of-sets-complete.tex

55 lines; SHA-256 d2b1a2f68e99efc2e5fd9f15316db26d7f898bd61135213309f61d28a6f00a60. Open the preserved source file.

  1. % Part: sets-functions-relations
  2. % Chapter: size-of-sets-complete
  3. \documentclass[../../../include/open-logic-chapter]{subfiles}
  4. \begin{document}
  5. \olchapter{sfr}{siz}{The Size of Sets}
  6. \begin{editorial}
  7. This chapter discusses enumerations, countability and uncountability.
  8. Several sections come in two versions: a more elementary one, that
  9. takes enumerations to be lists, or surjections from $\PosInt$; and a
  10. more abstract one that defines enumerations as bijections with $\Nat$.
  11. \end{editorial}
  12. \olimport{introduction}
  13. \olimport{enumerability}
  14. \olimport{zig-zag}
  15. \olimport{pairing}
  16. \olimport{pairing-alt}
  17. \olimport{non-enumerability}
  18. \olimport{reduction}
  19. \olimport{equinumerous-sets}
  20. \olimport{comparing-size}
  21. \olimport{schroder-bernstein}
  22. \begin{editorial}
  23. The following \olref[sfr][siz][enm-alt]{sec},
  24. \olref[sfr][siz][nen-alt]{sec}, \olref[sfr][siz][red-alt]{sec} are
  25. alternative versions of \olref[sfr][siz][enm]{sec},
  26. \olref[sfr][siz][nen]{sec}, \olref[sfr][siz][red]{sec} due to Tim
  27. Button for use in his Open Set Theory text. They are slightly more
  28. advanced and use a difference definition of enumerability more
  29. suitable in a set theory context (i.e., bijection with $\Nat$ or an
  30. initial segment, rather than being listable or being the range of a
  31. surjective function from $\PosInt$).
  32. \end{editorial}
  33. \olimport{enumerability-alt}
  34. \olimport{non-enumerability-alt}
  35. \olimport{reduction-alt}
  36. \OLEndChapterHook
  37. \end{document}

content/sets-functions-relations/size-of-sets/zig-zag.tex

126 lines; SHA-256 18bf058d52e22b9dbc7a08af314b58c81f35dd4009c0ccf726a0d00aec391dee. Open the preserved source file.

  1. % Part:sets-functions-relations
  2. % Chapter: size-of-sets
  3. % Section: zig-zag
  4. \documentclass[../../../include/open-logic-section]{subfiles}
  5. \begin{document}
  6. \olfileid{sfr}{siz}{zigzag}
  7. \olsection{Cantor's Zig-Zag Method}
  8. \begin{explain}
  9. We've already considered some ``easy'' enumerations. Now we will
  10. consider something a bit harder. Consider the set of pairs of natural
  11. numbers\oliflabeldef{sfr:set:pai:sec}{, which we defined in
  12. \olref[set][pai]{sec} thus:}{defined by:}
  13. \[
  14. \Nat \times \Nat = \Setabs{\tuple{n,m}}{n,m \in \Nat}
  15. \]
  16. We can organize these ordered pairs into an \emph{array}, like so:
  17. \[
  18. \begin{array}{ c | c | c | c | c | c}
  19. & \mathbf 0 & \mathbf 1 & \mathbf 2 & \mathbf 3 & \dots \\
  20. \hline
  21. \mathbf 0 & \tuple{0,0} & \tuple{0,1} & \tuple{0,2} & \tuple{0,3} & \dots \\
  22. \hline
  23. \mathbf 1 & \tuple{1,0} & \tuple{1,1} & \tuple{1,2} & \tuple{1,3} & \dots \\
  24. \hline
  25. \mathbf 2 & \tuple{2,0} & \tuple{2,1} & \tuple{2,2} & \tuple{2,3} & \dots \\
  26. \hline
  27. \mathbf 3 & \tuple{3,0} & \tuple{3,1} & \tuple{3,2} & \tuple{3,3} & \dots \\
  28. \hline
  29. \vdots & \vdots & \vdots & \vdots & \vdots & \ddots\\
  30. \end{array}
  31. \]
  32. Clearly, every ordered pair in $\Nat \times \Nat$ will appear
  33. exactly once in the array. In particular, $\tuple{n,m}$ will appear in
  34. the $n$th row and $m$th column. But how do we organize the elements of
  35. such an array into a ``one-dimensional'' list? The pattern in the array below
  36. demonstrates one way to do this (although of course there are many other options):
  37. \[
  38. \begin{array}{ c | c | c | c | c | c | c}
  39. & \mathbf 0 & \mathbf 1 & \mathbf 2 & \mathbf 3 & \mathbf 4 &\dots \\
  40. \hline
  41. \mathbf 0 & 0 & 1& 3 & 6& 10 &\ldots \\
  42. \hline
  43. \mathbf 1 &2 & 4& 7 & 11 & \dots &\ldots \\
  44. \hline
  45. \mathbf 2 & 5 & 8 & 12 & \ldots & \dots&\ldots \\
  46. \hline
  47. \mathbf 3 & 9 & 13 & \ldots & \ldots & \dots & \ldots \\
  48. \hline
  49. \mathbf 4 & 14 & \ldots & \ldots & \ldots & \dots & \ldots \\
  50. \hline
  51. \vdots & \vdots & \vdots & \vdots & \vdots&\ldots & \ddots\\
  52. \end{array}
  53. \]\noindent
  54. This pattern is called \emph{Cantor's zig-zag method}. It enumerates
  55. $\Nat \times \Nat$ as follows:
  56. \[
  57. \tuple{0,0}, \tuple{0,1}, \tuple{1,0}, \tuple{0,2}, \tuple{1,1},
  58. \tuple{2,0}, \tuple{0,3}, \tuple{1,2}, \tuple{2,1}, \tuple{3,0}, \dots
  59. \]
  60. And this establishes the following:
  61. \end{explain}
  62. \begin{prop}\ollabel{natsquaredenumerable}
  63. $\Nat \times \Nat$ is !!{enumerable}.
  64. \end{prop}
  65. \begin{proof}
  66. Let $f \colon \Nat \to \Nat\times\Nat$ take each $k \in \Nat$ to the
  67. tuple $\tuple{n,m} \in \Nat \times \Nat$ such that $k$ is the value of
  68. the $n$th row and $m$th column in Cantor's zig-zag array.
  69. \end{proof}
  70. \begin{explain}
  71. This technique also generalises rather nicely. For example, we can use
  72. it to enumerate the set of ordered triples of natural numbers, i.e.:
  73. \[
  74. \Nat \times \Nat \times \Nat = \Setabs{\tuple{n,m,k}}{n,m,k \in \Nat}
  75. \]
  76. We think of $\Nat \times \Nat \times \Nat$ as the Cartesian
  77. product of $\Nat \times \Nat$ with $\Nat$, that is,
  78. \[
  79. \Nat^3 = (\Nat \times \Nat) \times \Nat =
  80. \Setabs{\tuple{\tuple{n,m},k}}{n, m, k
  81. \in \Nat }
  82. \]
  83. and thus we can enumerate $\Nat^3$ with an array by labelling one
  84. axis with the enumeration of $\Nat$, and the other axis with the
  85. enumeration of $\Nat^2$:
  86. \[
  87. \begin{array}{ c | c | c | c | c | c}
  88. & \mathbf 0 & \mathbf 1 & \mathbf 2 & \mathbf 3 & \dots \\
  89. \hline
  90. \mathbf{\tuple{0,0}} & \tuple{0,0,0} & \tuple{0,0,1} & \tuple{0,0,2} & \tuple{0,0,3} & \dots \\
  91. \hline
  92. \mathbf{\tuple{0,1}} & \tuple{0,1,0} & \tuple{0,1,1} & \tuple{0,1,2} & \tuple{0,1,3} & \dots \\
  93. \hline
  94. \mathbf{\tuple{1,0}} & \tuple{1,0,0} & \tuple{1,0,1} & \tuple{1,0,2} & \tuple{1,0,3} & \dots \\
  95. \hline
  96. \mathbf{\tuple{0,2}} & \tuple{0,2,0} & \tuple{0,2,1} & \tuple{0,2,2} & \tuple{0,2,3} & \dots\\
  97. \hline
  98. \vdots & \vdots & \vdots & \vdots & \vdots & \ddots \\
  99. \end{array}
  100. \]
  101. Thus, by using a method like Cantor's zig-zag method, we may similarly
  102. obtain an enumeration of~$\Nat^3$. And we can keep going, obtaining
  103. enumerations of $\Nat^n$ for any natural number $n$. So, we have:
  104. \end{explain}
  105. \begin{prop}
  106. $\Nat^n$ is !!{enumerable}, for every $n \in \Nat$.
  107. \end{prop}
  108. \begin{prob}\label{sfr:siz:zigzag:prob:posint-n}
  109. Show that $(\PosInt)^n$ is !!{enumerable}, for every $n \in \Nat$.
  110. \end{prob}
  111. \begin{prob}\label{sfr:siz:zigzag:prob:posint-star}
  112. Show that $(\PosInt)^*$ is !!{enumerable}. You may assume \cref{sfr:siz:zigzag:prob:posint-n}.
  113. \end{prob}
  114. \end{document}