Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

A.1: Cardinality-additional info

( \newcommand{\kernel}{\mathrm{null}\,}\)

Basic Theory

Definitions

Suppose that S is a non-empty collection of sets. We define a relation on S by AB if and only if there exists a one-to-one function f from A onto B. The relation is an equivalence relation on S. That is, for all A,B,CS,

  1. AA, the reflexive property
  2. If AB then BA, the symmetric property
  3. If AB and \boldsymbol{B \approx C \} then AC, the transitive property
Proof

a. The identity function IA on A, given by IA(x)=x for xA, maps A one-to-one onto A. Hence AA.

b. If AB then there exists a one-to-one function f from A onto B. But then f1 is a one-to-one function from B onto A, so BA.

c. Suppose that AB and BC. Then there exists a one-to-one function f from A onto B and a one-to-one function g from B onto C. But then gf is a one-to-one function from A onto C, so AC.

A one-to-one function f from A onto B is sometimes called a bijection. Thus if AB then A and B are in one-to-one correspondence and are said to have the same cardinality. The equivalence classes under this equivalence relation capture the notion of having the same number of elements.

Let N0=, and for kN+, let Nk={0,1,k1}. As always, N={0,1,2,} is the set of all natural numbers.

Suppose that A is a set.

  1. A is finite if ANk for some kN, in which case k is the cardinality of A, and we write #(A)=k.
  2. A is infinite if A is not finite.
  3. A is countably infinite if AN.
  4. A is countable if A is finite or countably infinite.
  5. A is uncountable if A is not countable.

In part (a), think of Nk as a reference set with k elements; any other set with k elements must be equivalent to this one. We will study the cardinality of finite sets in the next two sections on Counting Measure and Combinatorial Structures. In this section, we will concentrate primarily on infinite sets. In part (d), a countable set is one that can be enumerated or counted by putting the elements into one-to-one correspondence with Nk for some kN or with all of N. An uncountable set is one that cannot be so counted. Countable sets play a special role in probability theory, as in many other branches of mathematics. Apriori, it's not clear that there are uncountable sets, but we will soon see examples.

Preliminary Examples

If S is a set, recall that P(S) denotes the power set of S (the set of all subsets of S). If A and B are sets, then AB is the set of all functions from B into A. In particular, {0,1}S denotes the set of functions from S into {0,1}.

If S is a set then P(S){0,1}S.

Proof

The mapping that takes a set AP(S) into its indicator function 1A{0,1}S is one-to-one and onto. Specifically, if A,BP(S) and \bs1A=\bs1B, then A=B, so the mapping is one-to-one. On the other hand, if f{0,1}S then f=\bs1A where A={xS:f(x)=1}. Hence the mapping is onto.

Next are some examples of countably infinite sets.

The following sets are countably infinite:

  1. The set of even natural numbers E={0,2,4,}
  2. The set of integers Z
Proof

a. The function f:NE given by f(n)=2n is one-to-one and onto.

b. The function g:NZ given by g(n)=n2 if n is even and g(n)=n+12 if n is odd, is one-to-one and onto.

At one level, it might seem that E has only half as many elements as N while Z has twice as many elements as N. as the previous result shows, that point of view is incorrect: N, E, and Z all have the same cardinality (and are countably infinite). The next example shows that there are indeed uncountable sets.

If A is a set with at least two elements then S=AN, the set of all functions from N into A, is uncountable.

Proof

The proof is by contradiction, and uses a nice trick known as the diagonalization method. Suppose that S is countably infinite (it's clearly not finite), so that the elements of S can be enumerated: S={f0,f1,f2,}. Let a and b denote distinct elements of A and define g:NA by g(n)=b if fn(n)=a and g(n)=a if fn(n)Nea. Note that gNefn. for each nN, so gNotinS. This contradicts the fact that S is the set of allfunctions from N into A.

Subsets of Infinite Sets

Surely a set must be as least as large as any of its subsets, in terms of cardinality. On the other hand, by example (4), the set of natural numbers N, the set of even natural numbers E and the set of integers Z all have exactly the same cardinality, even though ENZ. In this subsection, we will explore some interesting and somewhat paradoxical results that relate to subsets of infinite sets. Along the way, we will see that the countable infinity is the smallest of the infinities.

If S is an infinite set then S has a countable infinite subset.

Proof

Select a0S. It's possible to do this since S is infinite and therefore nonempty. Inductively, having chosen {a0,a1,,ak1}S, select akS{a0,a1,,ak1}. Again, it's possible to do this since S is not finite. Manifestly, {a0,a1,} is a countably infinite subset of S.

A set S is infinite if and only if S is equivalent to a proper subset of S.

Proof

If S is finite, then S is not equivalent to a proper subset by the pigeonhole principle. If S is infinite, then S has countably infinite subset {a0,a1,a2,} by the previous result. Define the function f:SS by f \left(a_n\mathbb{R}ight) = a_{2 n} for nN and f(x)=x for xS{a0,a1,a2,}. Then f maps S one-to-one onto S{a1,a3,a5,}.

When S was infinite in the proof of the previous result, not only did we map S one-to-one onto a proper subset, we actually threw away a countably infinite subset and still maintained equivalence. Similarly, we can add a countably infinite set to an infinite set S without changing the cardinality.

If S is an infinite set and B is a countable set, then SSB.

Proof

Consider the most extreme case where B is countably infinite and disjoint from S. Then S has a countably infinite subset A={a0,a1,a2,} by the result above, and B can be enumerated, so B={b0,b1,b2,}. Define the function f:SSB by f\left(a_n\mathbb{R}ight) = a_{n/2} if n is even, f\left(a_n\mathbb{R}ight) = b_{(n-1)/2} if n is odd, and f(x)=x if xS{a0,a1,a2,}. Then f maps S one-to-one onto SB.

In particular, if S is uncountable and B is countable then SB and SB have the same cardinality as S, and in particular are uncountable. In terms of the dichotomies finite-infinite and countable-uncountable, a set is indeed at least as large as a subset. First we need a preliminary result.

If S is countably infinite and AS then A is countable.

Proof

It suffices to show that if A is an infinite subset of S then A is countably infinite. Since S is countably infinite, it can be enumerated: S={x0,x1,x2,}. Let ni be the ith smallest index such that xniA. Then A={xn0,xn1,xn2,} and hence is countably infinite.

Suppose that AB.

  1. If B is finite, then A is finite.
  2. If A is infinite, then B is infinite.
  3. If B is countable, then A is countable.
  4. If A is uncountable, then B is uncountable.
Proof

a. This is clear from the definition of a finite set.

b. This is the contrapositive of (a).

c. If A is finite, then A is countable. If A is infinite, then B is infinite by (b) and hence is countably infinite. But then A is countably infinite by (9).

d. This is the contrapositive of (c).

Comparisons by one-to-one and onto functions

We will look deeper at the general question of when one set is at least as big as another, in the sense of cardinality. Not surprisingly, this will eventually lead to a partial order on the cardinality equivalence classes.

First note that if there exists a function that maps a set A one-to-one into a set B, then in a sense, there is a copy of A contained in B. Hence B should be at least as large as A.

Suppose that f:AB is one-to-one.

  1. If B is finite then A is finite.
  2. If A is infinite then B is infinite.
  3. If B is countable then A is countable.
  4. If A is uncountable then B is uncountable.
Proof

Note that f maps A one-to-one onto f(A). Hence Af(A) and f(A)B. The results now follow from (10):

a. If B is finite then f(A) is finite and hence A is finite.

b. If A is infinite then f(A) is infinite and hence B is infinite.

c. If B is countable then f(A) is countable and hence A is countable.

d. If A is uncountable then f(A) is uncountable and hence B is uncountable.

On the other hand, if there exists a function that maps a set A onto a set B, then in a sense, there is a copy of B contained in A. Hence A should be at least as large as B.

Suppose that f:AB is onto.

  1. If A is finite then B is finite.
  2. If B is infinite then A is infinite.
  3. If A is countable then B is countable.
  4. If B is uncountable then A is uncountable.
Proof

For each yB, select a specific xA with f(x)=y (if you are persnickety, you may need to invoke the axiom of choice). Let C be the set of chosen points. Then f maps C one-to-one onto B, so CB and CA. The results now follow from (11):

a. If A is finite then C is finite and hence B is finite.

b. If B is infinite then C is infinite and hence A is infinite.

c. If A is countable then C is countable and hence B is countable.

d. If B is uncountable then C is uncountable and hence A is uncountable.

The previous exercise also could be proved from the one before, since if there exists a function f mapping A onto B, then there exists a function g mapping B one-to-one into A. This duality is proven in the discussion of the axiom of choice. A simple and useful corollary of the previous two theorems is that if B is a given countably infinite set, then a set A is countable if and only if there exists a one-to-one function f from A into B, if and only if there exists a function g from B onto A.

If Ai is a countable set for each i in a countable index set I, then iIAi is countable.

Proof

Consider the most extreme case in which the index set I is countably infinite. Since Ai is countable, there exists a function fi that maps N onto Ai for each iN. Let M = \left\{2^i 3^j: (i, j) \in \mathbb{N} \times \mathbb{N}\mathbb{R}ight\}. Note that the points in M are distinct, that is, 2i3jNe2m3n if (i,j),(m,n)N×N and (i,j)Ne(m,n). Hence M is infinite, and since MN, M is countably infinite. The function f given by f\left(2^i 3^j\mathbb{R}ight) = f_i(j) for (i,j)N×N maps M onto iIAi, and hence this last set is countable.

If A and B are countable then A×B is countable.

Proof

There exists a function f that maps N onto A, and there exists a function g that maps N onto B. Again, let M = \left\{2^i 3^j: (i, j) \in \mathbb{N} \times \mathbb{N} \mathbb{R}ight\} and recall that M is countably infinite. Define h:MA×B by h\left(2^i 3^j\mathbb{R}ight) = \left(f(i), g(j)\mathbb{R}ight). Then h maps M onto A×B and hence this last set is countable.

The last result could also be proven from the one before, by noting that

A×B=aA{a}×B

Both proofs work because the set M is essentially a copy of N×N, embedded inside of N. The last theorem generalizes to the statement that a finite product of countable sets is still countable. But, from (5), a product of infinitely many sets (with at least 2 elements each) will be uncountable.

The set of rational numbers Q is countably infinite.

Proof

The sets Z and N+ are countably infinite and hence the set Z×N+ is countably infinite. The function f:Z×N+Q given by f(m,n)=mn is onto.

A real number is algebraic if it is the root of a polynomial function (of degree 1 or more) with integer coefficients. Rational numbers are algebraic, as are rational roots of rational numbers (when defined). Moreover, the algebraic numbers are closed under addition, multiplication, and division. A real number is transcendental if it's not algebraic. The numbers e and π are transcendental, but we don't know very many other transcendental numbers by name. However, as we will see, most (in the sense of cardinality) real numbers are transcendental.

The set of algebraic numbers A is countably infinite.

Proof

Let Z0=Z{0} and let Zn=Zn1×Z0 for nN+. The set Zn is countably infinite for each n. Let C=n=1Zn. Think of C as the set of coefficients and note that C is countably infinite. Let P denote the set of polynomials of degree 1 or more, with integer coefficients. The function (a0,a1,,an)a0+a1x++anxn maps C onto P, and hence P is countable. For pP, let Ap denote the set of roots of p. A polynomial of degree n in P has at most n roots, by the fundamental theorem of algebra, so in particular Ap is finite for each pP. Finally, note that A=pPAp and so A is countable. Of course NA, so A is countably infinite.

Now let's look at some uncountable sets.

The interval [0,1) is uncountable.

Proof

Recall that {0,1}N+ is the set of all functions from N+ into {0,1}, which in this case, can be thought of as infinite sequences or bit strings: {0,1}N+={\bsx=(x1,x2,):xn{0,1} for all nN+} By (5), this set is uncountable. Let N = \left\{\bs{x} \in \{0, 1\}^{\mathbb{N}_+}: x_n = 1 \text{ for all but finitely many } n\mathbb{R}ight\}, the set of bit strings that eventually terminate in all 1s. Note that N=n=1Nn where N_n = \left\{\bs{x} \in \{0, 1\}^{\mathbb{N}_+}: x_k = 1 \text{ for all } k \ge n\mathbb{R}ight\}. Clearly Nn is finite for all nN+, so N is countable, and therefore S={0,1}N+N is uncountable. In fact, S{0,1}N+. The function \bsxn=1xn2n maps S one-to-one onto [0,1). In words every number in [0,1) has a unique binary expansion in the form of a sequence in S. Hence [0,1)S and in particular, is uncountable. The reason for eliminating the bit strings that terminate in 1s is to ensure uniqueness, so that the mapping is one-to-one. The bit string x1x2xk0111 corresponds to the same number in [0,1) as the bit string x1x2xk1000.

The following sets have the same cardinality, and in particular all are uncountable:

  1. R, the set of real numbers.
  2. Any interval I of R, as long as the interval is not empty or a single point.
  3. RQ, the set of irrational numbers.
  4. RA, the set of transcendental numbers.
  5. P(N), the power set of N.
Proof

a. The mapping x2x1x(1x) maps (0,1) one-to-one onto R so (0,1)R. But (0,1)=[0,1){0}, so (0,1](0,1)R, and all of these sets are uncountable by the previous result.

b. Suppose a,bR and a<b. The mapping xa+(ba)x maps (0,1) one-to-one onto (a,b) and hence (a,b)(0,1)R. Also, [a,b)=(a,b){a}, (a,b]=(a,b){b}, and [a,b]=(a,b){a,b}, so (a,b)[a,b)(a,b][a,b]R. The function xex maps R one-to-one onto (0,), so (0,)R. For aR, the function xa+x maps (0,) one-to-one onto (a,) and the mapping xax maps (0,) one to one onto (,a) so (a,)(,a)(0,)R. Next, [a,)=(a,){a} and (,a]=(,a){a}, so [a,)(,a]R.

c. \Q is countably infinite, so R\QR.

d. Similarly, \A is countably infinite, so RAR.

e. If S is countably infinite, then by the previous result and (a), P(S)P(N+){0,1}N+[0,1).

The Cardinality Partial Order

Suppose that S is a nonempty collection of sets. We define the relation on S by AB if and only if there exists a one-to-one function f from A into B, if and only if there exists a function g from B onto A. In light of the previous subsection, AB should capture the notion that B is at least as big as A, in the sense of cardinality.

The relation is reflexive and transitive.

Proof

For AS, the identity function IA:AA given by IA(x)=x is one-to-one (and also onto), so AA. Suppose that A,B,CS and that AB and BC. Then there exist one-to-one functions f:AB and g:BC. But then gf:AC is one-to-one, so AC.

Thus, we can use the construction in the section on on Equivalence Relations to first define an equivalence relation on S, and then extend to a true partial order on the collection of equivalence classes. The only question that remains is whether the equivalence relation we obtain in this way is the same as the one that we have been using in our study of cardinality. Rephrased, the question is this: If there exists a one-to-one function from A into B and a one-to-one function from B into A, does there necessarily exist a one-to-one function from A onto B? Fortunately, the answer is yes; the result is known as the Schröder-Bernstein Theorem, named for Ernst Schröder and Sergi Bernstein.

If AB and BA then AB.

Proof

Set inclusion is a partial order on P(A) (the power set of A) with the property that every subcollection of P(A) has a supremum (namely the union of the subcollection). Suppose that f maps A one-to-one into B and g maps B one-to-one into A. Define the function h:P(A)P(A) by h(U)=Ag[Bf(U)] for UA. Then h is increasing: UVf(U)f(V)Bf(V)Bf(U)g[Bf(V)]g[Bf(U)]Ag[Bf(U)]Ag[Bf(U)] From the fixed point theorem for partially ordered sets, there exists UA such that h(U)=U. Hence U=Ag[Bf(U)] and therefore AU=g[Bf(U)]. Now define F:AB by F(x)=f(x) if xU and F(x)=g1(x) if xAU.

f maps U one-to-one onto f(U); g maps Bf(U) one-to-one onto AU

Schroder-Bernstein Theorem

Next we show that F is one-to-one. Suppose that x1,x2A and F(x1)=F(x2). If x1,x2U then f(x1)=f(x2) so x1=x2 since f is one-to-one. If x1,x2AU then g1(x1)=g1(x2) so x1=x2 since g1 is one-to-one. If x1U and x2AU. Then F(x1)=f(x1)f(U) while F(x2)=g1(x2)Bf(U), so F(x1)=F(x2) is impossible.

Finally we show that F is onto. Let yB. If yf(U) then y=f(x) for some xU so F(x)=y. If yBf(U) then x=g(y)AU so F(x)=g1(x)=y.

We will write AB if AB, but ANotB, That is, there exists a one-to-one function from A into B, but there does not exist a function from A onto B. Note that would have its usual meaning if applied to the equivalence classes. That is, [A][B] if and only if [A][B] but [A]Ne[B]. Intuitively, of course, AB means that B is strictly larger than A, in the sense of cardinality.

AB in each of the following cases:

  1. A and B are finite and #(A)<#(B).
  2. A is finite and B is countably infinite.
  3. A is countably infinite and B is uncountable.

We close our discussion with the observation that for any set, there is always a larger set.

If S is a set then SP(S).

Proof

First, it's trivial to map S one-to-one into P(S); just map x to {x}. Suppose now that f maps S onto P(S) and let R={xS:xNotinf(x)}. Since f is onto, there exists tS such that f(t)=R. Note that tf(t) if and only if tNotinf(t).

The proof that a set cannot be mapped onto its power set is similar to the Russell paradox, named for Bertrand Russell.

The continuum hypothesis is the statement that there is no set whose cardinality is strictly between that of N and R. The continuum hypothesis actually started out as the continuum conjecture, until it was shown to be consistent with the usual axioms of the real number system (by Kurt Gödel in 1940), and independent of those axioms (by Paul Cohen in 1963).

If S is uncountable, then there exists AS such that A and Ac are uncountable.

Proof

There is an easy proof, assuming the continuum hypothesis. Under this hypothesis, if S is uncountable then [0,1)S. Hence there exists a one-to-one function f:[0,1)S. Let A = f\left[0, \frac{1}{2}\mathbb{R}ight). Then A is uncountable, and since f\left[\frac{1}{2}, 1\mathbb{R}ight) \subseteq A^c, Ac is uncountable.

There is a more complicated proof just using the axiom of choice.


This page titled A.1: Cardinality-additional info is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by David Guichard via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?