SP20:Lecture 8 Cardinality

From CS2800 wiki

'Jectivity and inverses

There is a connection between 'jectivity and inverses:

We went through the first two of these claims in detail in this lecture. The proofs of the other two are similar.

Although we haven't proven them, you may use any of these claims without proof on the homework. I encourage you to prove them as excercises.

Injections have left inverses

If [math]A \href{/cs2800/wiki/index.php/Equality_(sets)}{\neq} \href{/cs2800/wiki/index.php?title=%5Cemptyset&action=edit&redlink=1}{\emptyset} [/math] and [math]f : A \href{/cs2800/wiki/index.php/%E2%86%92}{→} B [/math] is injective, then [math]f [/math] has a left inverse.
Proof: injections have left inverses
To demonstrate the technique of the proof, we start with an example.

Let [math]f := [/math] Fun-12-abc-1a2b.svg

We want to construct an inverse [math]g:\href{/cs2800/wiki/index.php/Enumerated_set}{\{a,b,c\}} \href{/cs2800/wiki/index.php/%E2%86%92}{→} \href{/cs2800/wiki/index.php/Enumerated_set}{\{1,2\}} [/math] for [math]f [/math]; obviously such a function must map [math]a [/math] to 1 and [math]b [/math] to 2. We must also define [math]g(c) [/math] (so that [math]g [/math] is a function, i.e. total). So we'll just arbitrarily choose a value to map it to (say, 2).

So we have [math]g := [/math] Fun-abc-12-a1b2c2.svg

Then we plug [math]g [/math] into the definition of left inverse and we see that [math](g \href{/cs2800/wiki/index.php/%5Ccirc}{\circ} f)(1) = 1 [/math] and [math](g \href{/cs2800/wiki/index.php/%5Ccirc}{\circ} f)(2) = 2 [/math], so that [math]g [/math] is indeed a left inverse.

Note that this wouldn't work if [math]f [/math] was not injective. For example,

if [math]f := [/math] Fun-abc-12-a1b2c2.svg

then the [math]g [/math] we constructed would need to map [math]2 [/math] to both [math]b [/math] and [math]c [/math]; if we did both then [math]g [/math] would be ambiguous and thus not a function. If we chose one of the two (say [math]b [/math]), then [math]g \href{/cs2800/wiki/index.php/%5Ccirc}{\circ} f [/math] would give the wrong answer on the other ([math](g \href{/cs2800/wiki/index.php/%5Ccirc}{\circ} f)(c) [/math] would be [math]b [/math], not [math]c [/math]).

Here is the general proof:

Choose an arbitrary [math]A \neq \href{/cs2800/wiki/index.php/%E2%88%85}{∅} [/math], [math]B [/math], and an injection [math]f : A \href{/cs2800/wiki/index.php/%E2%86%92}{→} B [/math]. We want to show that there exists a left inverse [math]g [/math] of [math]f [/math].

Let [math]x_0 [/math] be an element of [math]A [/math] (we know that such an element exists because [math]A \href{/cs2800/wiki/index.php/Equality_(sets)}{\neq} \href{/cs2800/wiki/index.php/%E2%88%85}{∅} [/math]).

Let [math]g : B \href{/cs2800/wiki/index.php/%E2%86%92}{→} A [/math] be given by

[math]g(y) := \left\{\begin{array}{ll} x & \text{if } \href{/cs2800/wiki/index.php/%E2%88%83}{∃x}\href{/cs2800/wiki/index.php/%E2%88%88}{∈}A \text{ such that } f(x) = y \\ x_0 & \text{otherwise} \\ \end{array}\right. [/math]

[math]g [/math] is well defined, because if [math]f(x_1) = y [/math] and [math]f(x_2) = y [/math] then [math]x_1 = x_2 [/math] (since [math]f [/math] is injective). Thus the output of [math]g [/math] is unambiguous.

To see that [math]g [/math] is a left inverse of [math]f [/math], choose an arbitrary [math]x \href{/cs2800/wiki/index.php/%E2%88%88}{∈} A [/math]; we have

[math]\begin{aligned} (g \href{/cs2800/wiki/index.php/%5Ccirc}{\circ} f)(x) &= g(f(x)) && \text{by definition of }\circ \\ &= x && \text{by definition of }g \\ &= id(x) && \text{by definition of }id \\ \end{aligned} [/math]

so [math]g \href{/cs2800/wiki/index.php/%5Ccirc}{\circ} f \href{/cs2800/wiki/index.php/Equality_(functions)}{=} \href{/cs2800/wiki/index.php?title=Id&action=edit&redlink=1}{id} [/math], which is the

definition of a left inverse.

Functions with left inverses are injections

If a function [math]f : A \href{/cs2800/wiki/index.php/%5Cto}{\to} B [/math] has a left inverse [math]g : B \href{/cs2800/wiki/index.php/%5Cto}{\to} A [/math], then [math]f [/math] is injective.
Proof: Functions with left inverses are injective
Assume [math]f : A \href{/cs2800/wiki/index.php/%5Cto}{\to} B [/math] has a left inverse [math]g : B \href{/cs2800/wiki/index.php/%5Cto}{\to} A [/math], so that [math]g \href{/cs2800/wiki/index.php/%5Ccirc}{\circ} f \href{/cs2800/wiki/index.php/Equality_(functions)}{=} \href{/cs2800/wiki/index.php?title=Id&action=edit&redlink=1}{id} [/math]. We want to show that [math]f [/math] is injective, i.e. that for all [math]x_1,x_2 \href{/cs2800/wiki/index.php/%5Cin}{\in} A [/math], if [math]f(x_1) = f(x_2) [/math] then [math]x_1 = x_2 [/math]. Choose arbitrary [math]x_1 [/math] and [math]x_2 [/math] in [math]A [/math], and assume that [math]f(x_1) = f(x_2) [/math]. Since [math]g \href{/cs2800/wiki/index.php/%5Ccirc}{\circ} f = \href{/cs2800/wiki/index.php?title=Id&action=edit&redlink=1}{id} [/math] have [math]x_1 = g(f(x_1)) = g(f(x_2)) = x_2 [/math], as required.

Cardinality definitions

You may have noticed that in our examples of injections [math]f : A \href{/cs2800/wiki/index.php/%E2%86%92}{→} B [/math], there are always at least as many elements in [math]B [/math] as there are in [math]A [/math]. Similarly, surjections always map to smaller sets, and bijections map to sets of the same size.

This insight lets us use functions to compare the sizes of sets in a way that applies to infinite sets as well as finite sets. We give some definitions here.

The cardinality of a set [math]A [/math] (written [math]|A| [/math]) is the size of the set. However, for the time being, we will not use this definition by itself. Doing so will encourage you to write proofs about cardinality that don't apply to infinite sets.

Instead, we will only define relationships between the cardinalities of sets; these definitions come from the intuitive relationship between sizes and 'jectivity described above.

If [math]A [/math] and [math]B [/math] are sets, then [math]|A| \href{/cs2800/wiki/index.php/%E2%89%A4}{≤} |B| [/math] means that there exists an injection [math]f : A \href{/cs2800/wiki/index.php/%E2%86%92}{→} B [/math]
If [math]A [/math] and [math]B [/math] are sets, then [math]|A| \href{/cs2800/wiki/index.php/%E2%89%A5}{≥} |B| [/math] means that there exists a surjection [math]f : A \href{/cs2800/wiki/index.php/%E2%86%92}{→} B [/math]
If [math]A [/math] and [math]B [/math] are sets, then [math]|A| \href{/cs2800/wiki/index.php/Equality_(cardinality)}{=} |B| [/math] means that there exists a bijection [math]f : A \href{/cs2800/wiki/index.php/%E2%86%92}{→} B [/math]

Cardinality properties

Note that it is dangerous to redefine symbols like ≤ and ≥! People expect that these relations work the same way they do for numbers, but it is not a-priori obvious that they do. For example, you might expect that

Luckily, these are all true (most will be proved on the homework), but it's important to note that they need to be proved!

The last of these claims is called the Cantor-Schroeder-Bernstein theorem; the proof is much more difficult than the others.