# Lecture 4 and beginning of 5: Cardinality

• Undefinition of |A|, defined |A|≤|B|, |A|≥|B|, |A|=|B|
• Listed properties to check
• Defined countability
• Considered some infinite sets
• pow(ℕ) is an uncountable set
• board image

## Cardinality definitions

Undefinition: Although we denote |A| to mean the number of elements of A for finite sets, we will not use this definition in this lecture (or the homework!), because it does not apply to infinite sets. We will not give a definition of |A| at all, in fact.

Definitions: - We define the expression |A|≥|B| to indicate that there exists a surjection from A to B. Equivalently, using the MCS notation, A surj B. - We define the expression |A|≤|B| to indicate that there exists an injection from A to B. Equivalently, using the MCS notation, A inj B. - We define the expression |A|=|B| to indicate that there exists a bijection from A to B. Equivalently, using the MCS notation, A bij B.

Mnemonic note: I find it convenient to remember that all the functions go from the set on the left hand side (A) to the set on the right hand side (B). To remember whether injection or surjection goes with bigger or smaller, I usually draw a picture.

## Things to check

We have redefined , , and = for cardinalities (even though we haven't defined cardinalities!). In order for this to be sensible, we should check several things:

• |A|≤|A|, |A|≥|A|, and |A|=|A| (reflexivity)
• if |A|≤|B| and |B|≤|C| then |A|≤|C| (transitivity)
• if |A|≤|B| and |A|≥|B| then |A|=|B| (antisymmetry)
• |A|≤|B| if and only if |B|≥|A|
• if we consider the other definition of cardinality for finite sets, these definitions match

We checked one of them; we'll put another on the homework.

Claim: If |A|≤|B| and |B|≤|C| then |A|≤|C|.

Proof: Suppose |A|≤|B| and |B|≤|C|. Then there exist injections f : A → B and g : B → C. Consider the function g ∘ f : A → C. I claim that g ∘ f is injective (and thus |A|≤|C|). To see this, we must show that for all a1, a2 ∈ A, if g ∘ f(a1)=g ∘ f(a2) then a1 = a2, so let's choose an arbitrary a1 and a2 and assume g ∘ f(a1)=g ∘ f(a2).

Now, if we define b1 = f(a1) and b2 = f(a2) then
g(b1)=g(f(a1)) = (g ∘ f)(a1)=(g ∘ f)(a2)=g(f(a2)) = g(b2)
Since g is injective, this means b1 = b2, and thus f(a1)=f(a2). Since f is also injective, we see that a1 = a2, which is what we were trying to prove. Thus g ∘ f is injective, so |A|≤|C|, as desired.

## Examples

Definition: A set X is countable if |ℕ|≥|X| (equivalently, by unchecked fact above, if |X|≤|ℕ|).

Informally, ∞ ≥ ∞ + 1:

Claim: |ℕ|≥|ℕ ∪ { − 1}|. Proof: let f : ℕ → ℕ ∪ { − 1} be defined by f(n): := n − 1. I claim f is a surjection. To see this, choose an arbitrary y in ℕ ∪ { − 1}. Then y ≥ −1, so x = y + 1 ∈ ℕ. But f(x)=y + 1 − 1 = y. Thus we have shown that for every y in the codomain of f, there exists an x in the domain of f with f(x)=y. In other words, f is surjective, and thus |ℕ|≥|ℕ ∪ { − 1}| as claimed.

Note: f is actually a bijection, and this is not hard to prove. Thus |ℕ| is actually equal to |ℕ ∪ { − 1}|. But our proof only shows surjectivity.

Informally, ∞ ≥ ∞ × ∞:

Claim: |ℕ × ℕ| is countable (i.e. |ℕ|≥|ℕ × ℕ|). Proof: We define f : ℕ → ℕ × ℕ by the following procedure. Start by writing all of the elements of ℕ × ℕ in a table:

 (0,0) (0,1) (0,2) ⋯ (1,0) (1,1) (1,2) ⋯ ⋮ ⋱

Now, to find f(n), traverse up-and-to-the-right diagonals, starting from the top left and working your way down. f(n) is the nth pair traversed. Here are the first few values of f:

n f(n)
0 (0,0)
1 (1,0)
2 (0,1)
3 (2,0)
4 (1,1)
5 (0,2)
6 (3,0)
7 (2,1)

This is a surjection, because every pair in the table eventually gets traversed. Thus |ℕ|≥|ℕ × ℕ| as claimed.

## Power set of naturals is uncountable

Claim: pow(ℕ) is uncountable. Proof: By contradiction. Assume that pow(ℕ) is countable. Then there is a surjection f : ℕ → pow(ℕ). We will derive a contradiction by finding a set SD that is not in the image of f.

We start with an example: suppose the first few values of f are given as follows:

n f(n)
0
1
2 {2, 3, 4}
3 all evens

We can expand out each row by indicating, for each j, whether j ∈ f(i):

i↓ j→ 0 1 2 3 4 5 j
0 no no no no no no
1 yes yes yes yes yes yes
2 no no yes yes yes no
3 yes no yes no yes no
i j ∈ f(i)?

Now we create the diabolical set by changing everything on the diagonal:

j→ 0 1 2 3 4 5 j
Sd yes no no yes j ∉ f(j)

We see that SD ≠ f(0) because 0 ∈ SD but 0 ∉ f(0). SD cannot be f(1) because 1 ∈ f(1) but 1 ∉ SD. In general, SD ≠ f(i) because if i ∈ f(i) then i ∉ SD, and if i ∉ f(i) then i ∈ SD.

Now the table we drew in our example is only one example, so it is not a proof. However, regardless of what f is, we can construct SD = {i|i ∉ f(i)}, and the argument that SD ≠ f(i) for any i is also general.

However, since SD is not f(i) for any i, we see that f cannot be surjective! This is a contradiction, and thus pow(ℕ) is not countable.