Countable set: Difference between revisions

Jump to navigation Jump to search
imported>Gmarmstrong
Reverting edit(s) by 2600:1700:A430:1F60:54FB:A743:D98D:CCDB (talk) to rev. 1282842943 by Piratespoonbar: Non-constructive edit (UV 0.1.6)
 
imported>Jordsan
Fixed typo
 
Line 6: Line 6:
In [[mathematics]], a [[Set (mathematics)|set]] is '''countable''' if either it is [[finite set|finite]] or it can be made in [[one to one correspondence]] with the set of [[natural number]]s.{{efn|name=ZeroN}} Equivalently, a set is ''countable'' if there exists an [[injective function]] from it into the natural numbers; this means that each element in the set may be associated to a unique natural number, or that the elements of the set can be counted one at a time, although the counting may never finish due to an infinite number of elements.
In [[mathematics]], a [[Set (mathematics)|set]] is '''countable''' if either it is [[finite set|finite]] or it can be made in [[one to one correspondence]] with the set of [[natural number]]s.{{efn|name=ZeroN}} Equivalently, a set is ''countable'' if there exists an [[injective function]] from it into the natural numbers; this means that each element in the set may be associated to a unique natural number, or that the elements of the set can be counted one at a time, although the counting may never finish due to an infinite number of elements.


In more technical terms, assuming the [[axiom of countable choice]], a set is ''countable'' if its [[cardinality]] (the number of elements of the set) is not greater than that of the natural numbers. A countable set that is not finite is said to be '''countably infinite'''.
In more technical terms, assuming the [[axiom of countable choice]], a set is ''countable'' if its [[cardinality]] (the number of elements of the set) is not greater than that of the natural numbers. A countable set that is not finite is said to be '''countably infinite'''; for example the set of all [[Natural number|natural numbers]] <math>\N</math> or all [[Rational number|rational numbers]] Q.


The concept is attributed to [[Georg Cantor]], who proved the existence of [[uncountable set]]s, that is, sets that are not countable; for example the set of the [[real number]]s.
The concept is attributed to [[Georg Cantor]], who proved the existence of [[uncountable set]]s, that is, sets that are not countable; for example the set of the [[real number]]s.
Line 31: Line 31:
* The elements of <math>S</math> can be arranged in an infinite sequence <math>a_0, a_1, a_2, \ldots</math>, where <math>a_i</math> is distinct from <math>a_j</math> for <math>i\neq j</math> and every element of <math>S</math> is listed.<ref>{{cite book |last1=Dlab |first1=Vlastimil |last2=Williams |first2=Kenneth S. |title=Invitation To Algebra: A Resource Compendium For Teachers, Advanced Undergraduate Students And Graduate Students In Mathematics |date=9 June 2020 |publisher=World Scientific |isbn=978-981-12-1999-3 |page=8 |url=https://books.google.com/books?id=l9rrDwAAQBAJ&pg=PA8 |language=en}}</ref><ref>{{harvnb|Tao|2016|p=182}}</ref>
* The elements of <math>S</math> can be arranged in an infinite sequence <math>a_0, a_1, a_2, \ldots</math>, where <math>a_i</math> is distinct from <math>a_j</math> for <math>i\neq j</math> and every element of <math>S</math> is listed.<ref>{{cite book |last1=Dlab |first1=Vlastimil |last2=Williams |first2=Kenneth S. |title=Invitation To Algebra: A Resource Compendium For Teachers, Advanced Undergraduate Students And Graduate Students In Mathematics |date=9 June 2020 |publisher=World Scientific |isbn=978-981-12-1999-3 |page=8 |url=https://books.google.com/books?id=l9rrDwAAQBAJ&pg=PA8 |language=en}}</ref><ref>{{harvnb|Tao|2016|p=182}}</ref>


A set is ''[[uncountable]]'' if it is not countable, i.e. its cardinality is greater than <math>\aleph_0</math>.<ref name=Yaqub>{{cite book |last1=Yaqub |first1=Aladdin M. |title=An Introduction to Metalogic |date=24 October 2014 |publisher=Broadview Press |isbn=978-1-4604-0244-3 |url=https://books.google.com/books?id=cyljCAAAQBAJ&pg=PT187 |language=en}}</ref>
A set is ''[[uncountable]]'' if it is not countable, i.e. its cardinality is strictly greater than <math>\aleph_0</math>.<ref name=Yaqub>{{cite book |last1=Yaqub |first1=Aladdin M. |title=An Introduction to Metalogic |date=24 October 2014 |publisher=Broadview Press |isbn=978-1-4604-0244-3 |url=https://books.google.com/books?id=cyljCAAAQBAJ&pg=PT187 |language=en}}</ref> That is, there is an injection from <math>\N</math> to <math>S</math>, but no injection from <math>S</math> to <math>\N</math>. In models where the [[axiom of choice]] fails, there might also be sets which are incomparable to <math>\N</math>, the so-called [[Dedekind finite]] infinite sets.


==History==
==History==
Line 37: Line 37:


==Introduction==
==Introduction==
A ''[[Set (mathematics)|set]]'' is a collection of ''elements'', and may be described in many ways. One way is simply to list all of its elements; for example, the set consisting of the integers 3, 4, and 5 may be denoted <math>\{3, 4, 5\}</math>, called roster form.<ref>{{Cite web|date=2021-05-09|title=What Are Sets and Roster Form?|url=https://www.expii.com/t/what-are-sets-and-roster-form-4300| url-status=live|website=expii|archive-url=https://web.archive.org/web/20200918224155/https://www.expii.com/t/what-are-sets-and-roster-form-4300 |archive-date=2020-09-18 }}</ref> This is only effective for small sets, however; for larger sets, this would be time-consuming and error-prone. Instead of listing every single element, sometimes an ellipsis ("...") is used to represent many elements between the starting element and the end element in a set, if the writer believes that the reader can easily guess what ... represents; for example, <math>\{1, 2, 3, \dots, 100\}</math> presumably denotes the set of [[integer]]s from 1 to 100. Even in this case, however, it is still ''possible'' to list all the elements, because the number of elements in the set is finite. If we number the elements of the set 1, 2, and so on, up to <math>n</math>, this gives us the usual definition of "sets of size <math>n</math>".
A ''[[Set (mathematics)|set]]'' is a collection of ''elements'', and may be described in many ways. One way is simply to list all of its elements; for example, the set consisting of the integers 3, 4, and 5 may be denoted <math>\{3, 4, 5\}</math>, called roster form.<ref>{{Cite web|date=2021-05-09|title=What Are Sets and Roster Form?|url=https://www.expii.com/t/what-are-sets-and-roster-form-4300| url-status=live|website=expii|archive-url=https://web.archive.org/web/20200918224155/https://www.expii.com/t/what-are-sets-and-roster-form-4300 |archive-date=2020-09-18 }}</ref> This is only effective for small sets, however; for larger sets, this would be time-consuming and error-prone. Instead of listing every single element, sometimes an ellipsis ("...") is used to represent many elements between the starting element and the end element in a set, if the writer believes that the reader can easily guess what "..." represents; for example, <math>\{1, 2, 3, \dots, 100\}</math> presumably denotes the set of [[integer]]s from 1 to 100. Even in this case, however, it is still ''possible'' to list all the elements, because the number of elements in the set is finite. If we number the elements of the set 1, 2, and so on, up to <math>n</math>, this gives us the usual definition of "sets of size <math>n</math>".


[[File:Aplicación 2 inyectiva sobreyectiva02.svg|thumb|x100px|Bijective mapping from integer to even numbers]]
[[File:Aplicación 2 inyectiva sobreyectiva02.svg|thumb|x100px|Bijective mapping from integer to even numbers]]
Line 44: Line 44:
or, more generally, <math>n \rightarrow 2n</math> (see picture). What we have done here is arrange the integers and the even integers into a ''one-to-one correspondence'' (or ''[[bijection]]''), which is a [[function (mathematics)|function]] that maps between two sets such that each element of each set corresponds to a single element in the other set. This mathematical notion of "size", cardinality, is that two sets are of the same size if and only if there is a bijection between them. We call all sets that are in one-to-one correspondence with the integers ''countably infinite'' and say they have cardinality <math>\aleph_0</math>.
or, more generally, <math>n \rightarrow 2n</math> (see picture). What we have done here is arrange the integers and the even integers into a ''one-to-one correspondence'' (or ''[[bijection]]''), which is a [[function (mathematics)|function]] that maps between two sets such that each element of each set corresponds to a single element in the other set. This mathematical notion of "size", cardinality, is that two sets are of the same size if and only if there is a bijection between them. We call all sets that are in one-to-one correspondence with the integers ''countably infinite'' and say they have cardinality <math>\aleph_0</math>.


[[Georg Cantor]] showed that not all infinite sets are countably infinite. For example, the real numbers cannot be put into one-to-one correspondence with the natural numbers (non-negative integers). The set of real numbers has a greater cardinality than the set of natural numbers and is said to be uncountable.
[[Georg Cantor]] showed that not all infinite sets are countably infinite. For example, the real numbers cannot be put into one-to-one correspondence with the natural numbers (non-negative integers).  
 
The set of real numbers has a greater cardinality than the set of natural numbers and is said to be uncountable. [[Cantor's diagonal argument]], provides the formal proof by using a ''[[Reductio ad absurdum|ad absurdum]]''  strategy. It begin with the assumption that the set of real numbers within the interval (0,1) is countable. If this were true, every real number in that range could be arranged into a sequential list (''s<sub>1</sub>,s<sub>2</sub>,s<sub>3</sub>'', ...) where each number is represented as an infinite decimal expansion. This structured list is the basis for constructing a specific real number that is logically guaranteed to be missing from the sequence, thereby invalidating the initial premise of countability.
 
The contradiction is formed when defining this new real number, <math>x</math>, where each <math>n</math>-th decimal digit is chosen specifically to differ from the <math>n</math>-th digit of the <math>n</math>-th number in the list. By ensuring each digit <math>x_n</math> is not equal to <math>d_n</math> (while avoiding 0 or 9 to prevent ambiguities with repeating decimals), the resulting number <math>x</math> is distinct from every element in the sequence by at least one decimal place. Since <math>x</math> is a real number between 0 and 1 that does not appear in the assumed to complete list, it follows that bijection cannot exist between the natural numbers and the real numbers.<ref>{{Cite book |last=Cantor |first=Georg |title=Ueber eine elementare Frage der Mannigfaltigkeitslehre |publisher=Druck and Verlag von Georg Reimer |year=1891 |location=Berlin, Germany |pages=75-78 |language= |trans-title=On an elementary question of set theory}}</ref>


==Formal overview==
==Formal overview==
Line 52: Line 56:
a \leftrightarrow 1,\ b \leftrightarrow 2,\ c \leftrightarrow 3
a \leftrightarrow 1,\ b \leftrightarrow 2,\ c \leftrightarrow 3
</math>
</math>
Since every element of <math>S=\{a,b,c\}</math> is paired with ''precisely one'' element of <math>\{1,2,3\}</math>, ''and'' vice versa, this defines a bijection, and shows that <math>S</math> is countable. Similarly we can show all finite sets are countable.
Since every element of <math>S=\{a,b,c\}</math> is paired with ''precisely one'' element of <math>\{1,2,3\}</math>, ''and'' vice versa, this defines a bijection, and shows that <math>S</math> is countable. Similarly we can show all finite sets to be countable.


As for the case of infinite sets, a set <math>S</math> is countably infinite if there is a [[bijection]] between <math>S</math> and all of <math>\N</math>. As examples, consider the sets <math>A=\{1,2,3,\dots\}</math>, the set of positive [[integer]]s, and <math>B=\{0,2,4,6,\dots\}</math>, the set of even integers. We can show these sets are countably infinite by exhibiting a bijection to the natural numbers. This can be achieved using the assignments <math>n \leftrightarrow n+1</math> and <math>n \leftrightarrow 2n</math>, so that
As for the case of infinite sets, a set <math>S</math> is countably infinite if there is a [[bijection]] between <math>S</math> and all of <math>\N</math>. As examples, consider the sets <math>A=\{1,2,3,\dots\}</math>, the set of positive [[integer]]s, and <math>B=\{0,2,4,6,\dots\}</math>, the set of even integers. We can show these sets are countably infinite by exhibiting a bijection to the natural numbers. This can be achieved using the assignments <math>n \leftrightarrow n+1</math> and <math>n \leftrightarrow 2n</math>, so that
Line 62: Line 66:
{{math theorem | math_statement = A subset of a countable set is countable.<ref>{{harvnb|Halmos|1960|page=91}}</ref>}}
{{math theorem | math_statement = A subset of a countable set is countable.<ref>{{harvnb|Halmos|1960|page=91}}</ref>}}


The set of all [[ordered pair]]s of natural numbers (the [[Cartesian product]] of two sets of natural numbers, <math>\N\times\N</math> is countably infinite, as can be seen by following a path like the one in the picture: [[File:Pairing natural.svg|thumb|300px|The [[Cantor pairing function]] assigns one natural number to each pair of natural numbers]] The resulting [[Map (mathematics)|mapping]] proceeds as follows:
The set of all [[ordered pair]]s of natural numbers (the [[Cartesian product]] of two sets of natural numbers, <math>\N\times\N</math>) is countably infinite, as can be seen by following a path like the one in the picture: [[File:Pairing natural.svg|thumb|300px|The [[Cantor pairing function]] assigns one natural number (blue) to each pair of natural numbers (horizontal,vertical coordinates).]] The resulting [[Map (mathematics)|mapping]] proceeds as follows:
<math display=block>
<math display=block>
0 \leftrightarrow (0, 0), 1 \leftrightarrow (1, 0), 2 \leftrightarrow (0, 1), 3 \leftrightarrow (2, 0), 4 \leftrightarrow (1, 1), 5 \leftrightarrow (0, 2), 6 \leftrightarrow (3, 0), \ldots
0 \leftrightarrow (0, 0), 1 \leftrightarrow (1, 0), 2 \leftrightarrow (0, 1), 3 \leftrightarrow (2, 0), 4 \leftrightarrow (1, 1), 5 \leftrightarrow (0, 2), 6 \leftrightarrow (3, 0), \ldots
Line 70: Line 74:
This form of triangular mapping [[recursion|recursively]] generalizes to <math>n</math>-[[tuple]]s of natural numbers, i.e., <math>(a_1,a_2,a_3,\dots,a_n)</math> where <math>a_i</math> and <math>n</math> are natural numbers, by repeatedly mapping the first two elements of an <math>n</math>-tuple to a natural number. For example, <math>(0, 2, 3)</math> can be written as <math>((0, 2), 3)</math>. Then <math>(0, 2)</math> maps to 5 so <math>((0, 2), 3)</math> maps to <math>(5, 3)</math>, then <math>(5, 3)</math> maps to 39. Since a different 2-tuple, that is a pair such as <math>(a,b)</math>, maps to a different natural number, a difference between two n-tuples by a single element is enough to ensure the n-tuples being mapped to different natural numbers. So, an injection from the set of <math>n</math>-tuples to the set of natural numbers <math>\N</math> is proved. For the set of <math>n</math>-tuples made by the Cartesian product of finitely many different sets, each element in each tuple has the correspondence to a natural number, so every tuple can be written in natural numbers then the same logic is applied to prove the theorem.
This form of triangular mapping [[recursion|recursively]] generalizes to <math>n</math>-[[tuple]]s of natural numbers, i.e., <math>(a_1,a_2,a_3,\dots,a_n)</math> where <math>a_i</math> and <math>n</math> are natural numbers, by repeatedly mapping the first two elements of an <math>n</math>-tuple to a natural number. For example, <math>(0, 2, 3)</math> can be written as <math>((0, 2), 3)</math>. Then <math>(0, 2)</math> maps to 5 so <math>((0, 2), 3)</math> maps to <math>(5, 3)</math>, then <math>(5, 3)</math> maps to 39. Since a different 2-tuple, that is a pair such as <math>(a,b)</math>, maps to a different natural number, a difference between two n-tuples by a single element is enough to ensure the n-tuples being mapped to different natural numbers. So, an injection from the set of <math>n</math>-tuples to the set of natural numbers <math>\N</math> is proved. For the set of <math>n</math>-tuples made by the Cartesian product of finitely many different sets, each element in each tuple has the correspondence to a natural number, so every tuple can be written in natural numbers then the same logic is applied to prove the theorem.


{{math theorem | math_statement = The [[Cartesian product]] of finitely many countable sets is countable.<ref>{{Harvard citation no brackets|Halmos|1960|page=92}}</ref>{{efn|'''Proof:''' Observe that <math>\N\times\N</math> is countable as a consequence of the definition because the function <math>f:\N\times\N\to\N</math> given by <math>f(m,n)=2^m\cdot3^n</math> is injective.<ref>{{Harvard citation no brackets|Avelsgaard|1990|page=182}}</ref>  It then follows that the Cartesian product of any two countable sets is countable, because if <math>A</math> and <math>B</math> are two countable sets there are surjections <math>f:\N\to A</math> and <math>g:\N\to B</math>. So <math>f\times g:\N\times\N\to A\times B</math>
{{math theorem
| math_statement = The [[Cartesian product]] of finitely many countable sets is countable.<ref>{{Harvard citation no brackets|Halmos|1960|page=92}}</ref>{{efn|'''Proof:''' Observe that <math>\N\times\N</math> is countable as a consequence of the definition because the function <math>f:\N\times\N\to\N</math> given by <math>f(m,n)=2^m\cdot3^n</math> is injective.<ref>{{Harvard citation no brackets|Avelsgaard|1990|page=182}}</ref>  It then follows that the Cartesian product of any two countable sets is countable, because if <math>A</math> and <math>B</math> are two countable sets there are surjections <math>f:\N\to A</math> and <math>g:\N\to B</math>. So <math>f\times g:\N\times\N\to A\times B</math>
is a surjection from the countable set <math>\N\times\N</math> to the set <math>A\times B</math> and the Corollary implies <math>A\times B</math> is countable. This result generalizes to the Cartesian product of any finite collection of countable sets and the proof follows by [[mathematical induction|induction]] on the number of sets in the collection.
is a surjection from the countable set <math>\N\times\N</math> to the set <math>A\times B</math> and the Corollary implies <math>A\times B</math> is countable. This result generalizes to the Cartesian product of any finite collection of countable sets and the proof follows by [[mathematical induction|induction]] on the number of sets in the collection.
}}}}
}}
}}


The set of all [[integer]]s <math>\Z</math> and the set of all [[rational number]]s <math>\Q</math> may intuitively seem much bigger than <math>\N</math>. But looks can be deceiving. If a pair is treated as the [[numerator]] and [[denominator]] of a [[vulgar fraction]] (a fraction in the form of <math>a/b</math> where <math>a</math> and <math>b\neq 0</math> are integers), then for every positive fraction, we can come up with a distinct natural number corresponding to it. This representation also includes the natural numbers, since every natural number <math>n</math> is also a fraction <math>n/1</math>. So we can conclude that there are exactly as many positive rational numbers as there are positive integers. This is also true for all rational numbers, as can be seen below.
The set of all [[integer]]s <math>\Z</math> and the set of all [[rational number]]s <math>\Q</math> may intuitively seem much bigger than <math>\N</math>. But looks can be deceiving. If a pair is treated as the [[numerator]] and [[denominator]] of a [[vulgar fraction]] (a fraction in the form of <math>a/b</math> where <math>a</math> and <math>b\neq 0</math> are integers), then for every positive fraction, we can come up with a distinct natural number corresponding to it. This representation also includes the natural numbers, since every natural number <math>n</math> is also a fraction <math>n/1</math>. So we can conclude that there are exactly as many positive rational numbers as there are positive integers. This is also true for all rational numbers, as can be seen below.


{{math theorem | math_statement = <math>\Z</math> (the set of all integers) and <math>\Q</math> (the set of all rational numbers) are countable.{{efn|'''Proof:''' The integers <math>\Z</math> are countable because the function <math>f:\Z\to\N</math> given by <math>f(n)=2^n</math> if <math>n</math> is non-negative and <math>f(n)=3^{-n}</math> if <math>n</math> is negative, is an injective function. The rational numbers <math>\Q</math> are countable because the function <math>g:\Z\times\N\to\Q</math> given by <math>g(m,n)=m/(n+1)</math> is a surjection from the countable set <math>\Z\times\N</math> to the rationals <math>\Q</math>.}}}}
{{math theorem
| math_statement = <math>\Z</math> (the set of all integers) and <math>\Q</math> (the set of all rational numbers) are countable.{{efn|'''Proof:''' The integers <math>\Z</math> are countable because the function <math>f:\Z\to\N</math> given by <math>f(n)=2n</math> if <math>n \geq 0</math> and <math>f(n)=-2n-1</math> if <math>n<0</math>, is a bijective function. The rational numbers <math>\Q</math> are countable because the function <math>g:\Z\times\N\to\Q</math> given by <math>g(m,n)=m/(n+1)</math> is a surjection from the countable set <math>\Z\times\N</math> to the rationals <math>\Q</math>.}}
}}


In a similar manner, the set of [[algebraic number]]s is countable.<ref>{{Harvard citation no brackets|Kamke|1950|pages=3–4}}</ref>{{efn|1='''Proof:''' Per definition, every algebraic number (including complex numbers) is a root of a polynomial with integer coefficients. Given an algebraic number <math>\alpha</math>, let <math>a_0x^0 + a_1 x^1 + a_2 x^2 + \cdots + a_n x^n</math> be a polynomial with integer coefficients such that <math>\alpha</math> is the <math>k</math>-th root of the polynomial, where the roots are sorted by absolute value from small to big, then sorted by argument from small to big. We can define an injection (i. e. one-to-one) function <math>f:\mathbb{A}\to\Q</math> given by <math>f(\alpha) = 2^{k-1} \cdot 3^{a_0} \cdot 5^{a_1} \cdot 7^{a_2} \cdots {p_{n+2}}^{a_n}</math>, where <math>p_n</math> is the <math>n</math>-th [[prime number|prime]].}}
In a similar manner, the set of [[algebraic number]]s is countable.<ref>{{Harvard citation no brackets|Kamke|1950|pages=3–4}}</ref>{{efn|1='''Proof:''' Per definition, every algebraic number (including complex numbers) is a root of a polynomial with integer coefficients. Given an algebraic number <math>\alpha</math>, let <math>a_0x^0 + a_1 x^1 + a_2 x^2 + \cdots + a_n x^n</math> be a polynomial with integer coefficients such that <math>\alpha</math> is the <math>k</math>-th root of the polynomial, where the roots are sorted by absolute value from small to big, then sorted by argument from small to big. We can define an injection (i. e. one-to-one) function <math>f:\mathbb{A}\to\Q</math> given by <math>f(\alpha) = 2^{k-1} \cdot 3^{a_0} \cdot 5^{a_1} \cdot 7^{a_2} \cdots {p_{n+2}}^{a_n}</math>, where <math>p_n</math> is the <math>n</math>-th [[prime number|prime]].}}


Sometimes more than one mapping is useful: a set <math>A</math> to be shown as countable is one-to-one mapped (injection) to another set <math>B</math>, then <math>A</math> is proved as countable if <math>B</math> is one-to-one mapped to the set of natural numbers. For example, the set of positive [[rational number]]s can easily be one-to-one mapped to the set of natural number pairs (2-tuples) because <math>p/q</math> maps to <math>(p,q)</math>. Since the set of natural number pairs is one-to-one mapped (actually one-to-one correspondence or bijection) to the set of natural numbers as shown above, the positive rational number set is proved as countable.
Sometimes more than one mapping is useful: if a set <math>A</math> to be shown as countable is one-to-one mapped (injection) to another set <math>B</math>, then <math>A</math> is proved as countable if <math>B</math> is one-to-one mapped to the set of natural numbers. For example, the set of positive [[rational number]]s can easily be one-to-one mapped to the set of natural number pairs (2-tuples) because <math>p/q</math> maps to <math>(p,q)</math>. Since the set of natural number pairs is one-to-one mapped (actually one-to-one correspondence or bijection) to the set of natural numbers as shown above, the positive rational number set is proved as countable.


{{math theorem | math_statement = Any finite [[union (set theory)|union]] of countable sets is countable.<ref>{{Harvard citation no brackets|Avelsgaard|1990|page=180}}</ref><ref>{{Harvard citation no brackets|Fletcher|Patty|1988|page=187}}</ref>{{efn|1='''Proof:''' If <math>A_i</math> is a countable set for each <math>i</math> in <math>I=\{1,\dots,n\}</math>, then for each <math>i</math> there is a surjective function <math>g_i:\N\to A_i</math> and hence the function
{{math theorem
| math_statement = Any finite [[union (set theory)|union]] of countable sets is countable.<ref>{{Harvard citation no brackets|Avelsgaard|1990|page=180}}</ref><ref>{{Harvard citation no brackets|Fletcher|Patty|1988|page=187}}</ref>{{efn|1='''Proof:''' If <math>A_i</math> is a countable set for each <math>i</math> in <math>I=\{1,\dots,n\}</math>, then for each <math>i</math> there is a surjective function <math>g_i:\N\to A_i</math> and hence the function
<math display="block">G : I \times \mathbf{N} \to \bigcup_{i \in I} A_i,</math>
<math display="block">G : I \times \mathbf{N} \to \bigcup_{i \in I} A_i,</math>
given by <math>G(i,m)=g_i(m)</math> is a surjection.  Since <math>I\times \N</math> is countable, the union <math display="inline">\bigcup_{i \in I} A_i</math> is countable.
given by <math>G(i,m)=g_i(m)</math> is a surjection.  Since <math>I\times \N</math> is countable, the union <math display="inline">\bigcup_{i \in I} A_i</math> is countable.
}}}}
}}
}}


With the foresight of knowing that there are uncountable sets, we can wonder whether or not this last result can be pushed any further. The answer is "yes" and "no", we can extend it, but we need to assume a new axiom to do so.
With the foresight of knowing that there are uncountable sets, we can wonder whether or not this last result can be pushed any further. The answer is "yes" and "no", we can extend it, but we need to assume a new axiom to do so.


{{math theorem | math_statement = (Assuming the [[axiom of countable choice]]) The union of countably many countable sets is countable.{{efn|1='''Proof''': As in the finite case, but <math>I=\N</math> and we use the [[axiom of countable choice]] to pick for each <math>i</math> in <math>\N</math> a surjection <math>g_i</math> from the non-empty collection of surjections from <math>\N</math> to <math>A_i</math>.<ref>{{cite book |last1=Hrbacek |first1=Karel |last2=Jech |first2=Thomas |title=Introduction to Set Theory, Third Edition, Revised and Expanded |date=22 June 1999 |publisher=CRC Press |isbn=978-0-8247-7915-3 |page=141 |url=https://books.google.com/books?id=Er1r0n7VoSEC&pg=PA141 |language=en}}</ref> Note that since we are considering the surjection <math>G : \mathbf{N} \times \mathbf{N} \to \bigcup_{i \in I} A_i</math>, rather than an injection, there is no requirement that the sets be disjoint.}}}}
{{math theorem
| math_statement = (Assuming the [[axiom of countable choice]]) The union of countably many countable sets is countable.{{efn|1='''Proof''': As in the finite case, but <math>I=\N</math> and we use the [[axiom of countable choice]] to pick for each <math>i</math> in <math>\N</math> a surjection <math>g_i</math> from the non-empty collection of surjections from <math>\N</math> to <math>A_i</math>.<ref>{{cite book |last1=Hrbacek |first1=Karel |last2=Jech |first2=Thomas |title=Introduction to Set Theory, Third Edition, Revised and Expanded |date=22 June 1999 |publisher=CRC Press |isbn=978-0-8247-7915-3 |page=141 |url=https://books.google.com/books?id=Er1r0n7VoSEC&pg=PA141 |language=en}}</ref> Note that since we are considering the surjection <math>G : \mathbf{N} \times \mathbf{N} \to \bigcup_{i \in I} A_i</math>, rather than an injection, there is no requirement that the sets be disjoint.}}
}}


[[File:Countablepath.svg|thumb|300px|Enumeration for countable number of countable sets]]
[[File:Countablepath.svg|thumb|300px|Enumeration for countable number of countable sets]]
Line 113: Line 125:
We need the [[axiom of countable choice]] to index ''all'' the sets <math>\textbf{a},\textbf{b},\textbf{c},\dots</math> simultaneously.
We need the [[axiom of countable choice]] to index ''all'' the sets <math>\textbf{a},\textbf{b},\textbf{c},\dots</math> simultaneously.


{{math theorem | math_statement = The set of all finite-length [[sequence]]s of natural numbers is countable.}}
{{math theorem
| math_statement = The set of all finite-length [[sequence]]s of natural numbers is countable.
}}


This set is the union of the length-1 sequences, the length-2 sequences, the length-3 sequences, and so on, each of which is a countable set (finite Cartesian product). Thus the set is a countable union of countable sets, which is countable by the previous theorem.
This set is the union of the length-1 sequences, the length-2 sequences, the length-3 sequences, and so on, each of which is a countable set (finite Cartesian product). Thus the set is a countable union of countable sets, which is countable by the previous theorem.


{{math theorem | math_statement = The set of all finite [[subset]]s of the natural numbers is countable.}}
{{math theorem
| math_statement = The set of all finite [[subset]]s of the natural numbers is countable.
}}


The elements of any finite subset can be ordered into a finite sequence. There are only countably many finite sequences, so also there are only countably many finite subsets.
The elements of any finite subset can be ordered into a finite sequence. There are only countably many finite sequences, so also there are only countably many finite subsets.


{{math theorem | math_statement = Let <math>S</math> and <math>T</math> be sets.
{{math theorem
| math_statement = Let <math>S</math> and <math>T</math> be sets.
# If the function <math>f:S\to T</math> is injective and <math>T</math> is countable then <math>S</math> is countable.
# If the function <math>f:S\to T</math> is injective and <math>T</math> is countable then <math>S</math> is countable.
# If the function <math>g:S\to T</math> is surjective and <math>S</math> is countable then <math>T</math> is countable.}}
# If the function <math>g:S\to T</math> is surjective and <math>S</math> is countable then <math>T</math> is countable.
}}


These follow from the definitions of countable set as injective / surjective functions.{{efn|'''Proof''': For (1) observe that if <math>T</math> is countable there is an injective function  <math>h:T\to\N</math>.  Then if <math>f:S\to T</math> is injective the composition <math>h\circ f:S\to \N</math> is injective, so <math>S</math> is countable.
These follow from the definitions of countable set as injective / surjective functions.{{efn|'''Proof''': For (1) observe that if <math>T</math> is countable there is an injective function  <math>h:T\to\N</math>.  Then if <math>f:S\to T</math> is injective the composition <math>h\circ f:S\to \N</math> is injective, so <math>S</math> is countable.
Line 131: Line 149:


'''[[Cantor's theorem]]''' asserts that if <math>A</math> is a set and <math>\mathcal{P}(A)</math> is its [[power set]], i.e. the set of all subsets of <math>A</math>, then there is no surjective function from <math>A</math> to <math>\mathcal{P}(A)</math>. A proof is given in the article [[Cantor's theorem]]. As an immediate consequence of this and the Basic Theorem above we have:
'''[[Cantor's theorem]]''' asserts that if <math>A</math> is a set and <math>\mathcal{P}(A)</math> is its [[power set]], i.e. the set of all subsets of <math>A</math>, then there is no surjective function from <math>A</math> to <math>\mathcal{P}(A)</math>. A proof is given in the article [[Cantor's theorem]]. As an immediate consequence of this and the Basic Theorem above we have:
{{math theorem | name = Proposition | math_statement = The set <math>\mathcal{P}(\N)</math> is not countable; i.e. it is [[uncountable]].}}
{{math theorem
| name = Proposition
| math_statement = The set <math>\mathcal{P}(\N)</math> is not countable; i.e. it is [[uncountable]].
}}


For an elaboration of this result see [[Cantor's diagonal argument]].
For an elaboration of this result see [[Cantor's diagonal argument]].