5.2 Workshop 2 (Reading)

5.2.1 Preparatory Exercises (1 hour)

Task 5.10.

Find an example and a non-example for each of the following definitions.

Definition (Injective, injection).

A function f:DCf:D\to C is said to be injective (or an injection) if f(x1)=f(x2)f(x_{1})=f(x_{2}) implies x1=x2x_{1}=x_{2} for every x1,x2Dx_{1},x_{2}\in D.

Definition (Surjective, surjection).

A function f:DCf:D\to C is said to be surjective (or a surjection) if, given any yCy\in C, there is some xDx\in D such that f(x)=yf(x)=y.

Definition (Bijective, bijection).

A function is said to be bijective if it is both injective and surjective.

Task 5.11.

Consider the function f:f:\mathbb{R}\rightarrow\mathbb{R} such that

f(x)={x+1, if x<0,2x+a, if x0,f(x)=\begin{cases}x+1,\text{ if }x<0,\\ 2x+a,\text{ if }x\geqslant 0,\end{cases}

where aa is some real number.

Is ff injective? Is ff surjective?

Task 5.12.

Read the proofs of Claim A and Claim B (below).

  1. 1.

    Highlight the key parts of the proofs. Are there any parts which you do not understand or are not convinced by?

  2. 2.

    Compare the two proofs. What are the key differences between them?

  3. 3.

    Consider ff in Claim A. Is ff bijective? Can you change the domain so that ff is no longer injective? Where does the proof break down?

  4. 4.

    Consider gg in Claim B. Is gg bijective? Can you change the codomain so that gg is no longer surjective? Where does the proof break down?

Note: We define 0={0}\mathbb{N}_{0}=\mathbb{N}\cup\{0\}.

Claim A: The function f:00f\colon\mathbb{N}_{0}\rightarrow\mathbb{N}_{0} defined by f(n)=n2f(n)=n^{2} is injective.

Proof.

Let m,n0m,n\in\mathbb{N}_{0} be such that f(m)=f(n)f(m)=f(n). Then m2=n2m^{2}=n^{2}, and so

0=m2n2=(mn)(m+n).0=m^{2}-n^{2}=(m-n)(m+n).

If m+n=0m+n=0 then m=0m=0 and n=0n=0, so m=nm=n. Otherwise, mn=0m-n=0, so m=nm=n. Thus ff is injective.

Claim B: The function g:[5,+)g\colon\mathbb{R}\rightarrow[-5,+\infty) defined by g(x)=x2+2x4g(x)=x^{2}+2x-4 is surjective.

Proof.

Let y5y\geq-5. We need to show there is some xx\in\mathbb{R} such that g(x)=yg(x)=y. Observe that g(x)=yx2+2x4=yg(x)=y\iff x^{2}+2x-4=y. By the quadratic formula, that means

x=2±4+4(4+y)2x=\frac{-2\pm\sqrt{4+4(4+y)}}{2}

and since y5y\geq-5, the square root is defined and this gives our value for xx. Thus, since we can find such an xx\in\mathbb{R} for every y[5,)y\in[-5,\infty), this implies that gg is surjective.

5.2.2 B3 Reading Workshop Supplementary Material

For Task B3.2.1:

Theorem.

Let f:XYf:X\rightarrow Y and g:YZg:Y\rightarrow Z be functions.

  1. 1.

    If ff and gg are injective, so is gfg\circ f.

  2. 2.

    If ff and gg are surjective, so is gfg\circ f.

  3. 3.

    If ff and gg are bijective, so is gfg\circ f.

Proof.
  1. 1.

    Suppose ff and gg are injective. To show that gfg\circ f is injective, we need to show that if ... (with x,xXx,x^{\prime}\in X), then ... .

    So, suppose x,xXx,x^{\prime}\in X satisfies .... Then g(f(x))=g(f(x))g(f(x))=g(f(x^{\prime})). Since gg is ... , this means ... . Since ff is ... this implies ... , as desired.

    This completes the proof that gfg\circ f is injective.

  2. 2.

    Now suppose ff and gg are surjective. To show that gfg\circ f is surjective, we need to show that for all ... , there is some ... such that ... .

    Let zZz\in Z. Since gg is ... , there is some ... such that ... . Since ff is ... , there is some xXx\in X such that ... . Then

    ...

    as desired.

    This finishes the proof that gfg\circ f is surjective.

  3. 3.

    If gg and ff are bijective, then they are both injective and surjective, so by the previous two parts, gfg\circ f is also both injective and surjective, hence gfg\circ f is bijective.

For Task B3.2.2:

Theorem.

Let XX and YY be finite sets and let f:XYf:X\rightarrow Y be a function.

  1. a)

    If ff is injective, then |X||Y||X|\leq|Y|.

  2. b)

    If ff is surjective, then |X||Y||X|\geq|Y|.

  3. c)

    If ff is bijective, then |X|=|Y||X|=|Y|.

5.1.

Since YY is finite, we can list its elements as y1,,ymy_{1},\ldots,y_{m} where m=|Y|m=|Y|.

5.2.

If ff is injective, then the elements f(x1),,f(xn)f(x_{1}),\ldots,f(x_{n}) are distinct.

5.3.

Therefore there are exactly mm elements in the set A={x1,,xm}A=\{x_{1},\ldots,x_{m}\}.

5.4.

Since XX is finite, we can list its elements as x1,,xnx_{1},\ldots,x_{n} where n=|X|n=|X|.

5.5.

Since this is a subset of YY, the set YY must have at least as many elements as BB, so |Y|n=|X||Y|\geq n=|X|.

5.6.

If ff is surjective, then for each i=1,,mi=1,\ldots,m, we can choose distinct xiXx_{i}\in X such that f(xi)=yif(x_{i})=y_{i}.

5.7.

Since this is a subset of XX, the set XX must have at least as many elements as AA, so |X|m=|Y||X|\geq m=|Y|.

5.8.

This follows by combining results (a) and (b).

5.9.

Therefore there are exactly nn elements in the set B={f(x1),,f(xn))}B=\{f(x_{1}),\ldots,f(x_{n}))\}.

For Task B3.2.3:

Definition (Countable and uncountable sets).

A set SS is said to be countable if it is finite or if there is a bijection from \mathbb{N} to SS.

An infinite countable set is said to be countably infinite.

A set that is not countable is said to be uncountable.

Claim.

Consider the function f:f:\mathbb{N}\to\mathbb{Z} which is defined by:

f(n)={n2if n is even,n12if n is odd.f(n)=\begin{cases}-\frac{n}{2}&\text{if $n$ is even,}\\ \frac{n-1}{2}&\text{if $n$ is odd.}\end{cases}

The function ff is bijective.

Proof.

For ff to be bijective, it needs to be both injective and surjective.

To show that ff is injective, we need to show that if f(n)=f(n)f(n)=f(n^{\prime}) for n,nn,n^{\prime}\in\mathbb{N}, then n=nn=n^{\prime}.

So, suppose n,nn,n^{\prime}\in\mathbb{N} such that f(n)=f(n)f(n)=f(n^{\prime}). Then, nn is either even or odd. If nn is even, then f(n)=n2=n2=f(n)f(n)=-\frac{n}{2}=-\frac{n^{\prime}}{2}=f(n^{\prime}). Rearranging, we get n=nn=n^{\prime} as desired.

Alternatively, if nn is odd, then f(n)=n12=n12=f(n)f(n)=\frac{n-1}{2}=\frac{n^{\prime}-1}{2}=f(n^{\prime}). Again, rearranging gives n=nn=n^{\prime}.

This completes the proof that ff is injective.

To show that ff is surjective, we need to show that for all mm\in\mathbb{Z}, there is some nn\in\mathbb{N} such that m=f(n)m=f(n).

Let mm\in\mathbb{Z}. If mm is non-negative, then we can take n=2m+1n=2m+1. Note that nn is an odd natural number so f(n)=2m+112=mf(n)=\frac{2m+1-1}{2}=m as desired.

On the other hand, if mm is negative, then we can set n=2mn=-2m. Then nn is an even positive number and hence a natural number. We have f(n)=2m2=mf(n)=-\frac{-2m}{2}=m.

Therefore ff is surjective.

As ff is both surjective and injective, it is bijective.

Corollary.

The set \mathbb{Z} is countable.

For Task B3.2.4:

Theorem.

Let SS be any infinite set. The following are equivalent:

  1. (i)

    SS is countably infinite;

  2. (ii)

    there is a surjection from \mathbb{N} to SS;

  3. (iii)

    there is an injection from SS to \mathbb{N}.

Proof.

  • (i) \Rightarrow (ii): If SS is countably infinite then, by definition, there is a bijection from \mathbb{N} to SS. Thus there is a surjection from \mathbb{N} to SS.

  • (ii) \Rightarrow (iii): Suppose f:Sf:\mathbb{N}\to S is surjective. Then, for any xSx\in S, the set f1({x})f^{-1}(\{x\})\subseteq\mathbb{N} is nonempty and so has a unique smallest element, call it nxn_{x}. Then g:Sg:S\to\mathbb{N} defined by g(x)=nxg(x)=n_{x} is injective.

  • (iii) \Rightarrow (i): Suppose h:Sh:S\to\mathbb{N} is injective. Then, since SS is an infinite set and no pair of elements in SS are mapped (under hh) to the same natural number, h(S)h(S) is an infinite subset of \mathbb{N} and is therefore countable.

5.2.3 Workshop Tasks

Task 5.13 (5 mins).

(Warm Up)

  1. 1.

    In your Preparatory Exercises, you were asked to consider the function f:f:\mathbb{R}\rightarrow\mathbb{R} such that

    f(x)={x+1, if x<0,2x+a, if x0,f(x)=\begin{cases}x+1,\text{ if }x<0,\\ 2x+a,\text{ if }x\geqslant 0,\end{cases}

    where aa is some real number.

    1. (a)

      Did you think the function is injective or surjective (or both)? Share your thoughts with your group.

    2. (b)

      Sketch the graph of ff. Can you think of a visual way to indicate when a function is injective, surjective or bijective?

  2. 2.

    What key steps for proving injectivity and surjectivity did you highlight in the proofs of Claim A and Claim B in the Preparatory Exercises? Share them with your group.

  3. 3.

    EXTENSION: Try to draft a proof of the claims you made for the function ff.

Task 5.14 (10 mins).

If we have a bijective function f:DCf:D\to C, we can define a new function f1:CDf^{-1}:C\to D such that f1(y)=xf(x)=yf^{-1}(y)=x\iff f(x)=y and we call f1f^{-1} the inverse of ff. This means that ff1f\circ f^{-1} and f1ff^{-1}\circ f are identity functions.

  1. 1.

    If f:DCf:D\to C is NOT bijective, is f1:CDf^{-1}:C\to D such that f1(y)=xf(x)=yf^{-1}(y)=x\iff f(x)=y a valid function?

  2. 2.

    What is wrong with the following argument?

    “Suppose f:STf:S\to T is a function with ASA\subseteq S and BTB\subseteq T. Since ff1f\circ f^{-1} and f1ff^{-1}\circ f are identity functions idTid_{T} and idSid_{S} by definition of the inverse function f1f^{-1}, it follows that f(f1(B))=idT(B)=BBf(f^{-1}(B))=id_{T}(B)=B\subseteq B and f1(f(A))=idS(A)=AAf^{-1}(f(A))=id_{S}(A)=A\subseteq A by definition of the identity function. Hence, for all functions ff, we have f(f1(B))Bf(f^{-1}(B))\subseteq B and f1(f(A))Af^{-1}(f(A))\subseteq A.”

  3. 3.

    EXTENSION: Prove that ff1f\circ f^{-1} and f1ff^{-1}\circ f are identity functions.

Task 5.15 (10 mins).

(B3.2.1) In your supplementary material for this task, you’ve been given a sparse proof structure for the following theorem:

Theorem.

Let f:XYf:X\rightarrow Y and g:YZg:Y\rightarrow Z be functions.

  1. 1.

    If ff and gg are injective, so is gfg\circ f.

  2. 2.

    If ff and gg are surjective, so is gfg\circ f.

  3. 3.

    If ff and gg are bijective, so is gfg\circ f.

  1. 1.

    Complete the proof by filling in the gaps.

  2. 2.

    EXTENSION: If gfg\circ f is injective, is ff or gg injective? If gfg\circ f is surjective, is ff or gg surjective?

Theorem.

Let f:XYf:X\rightarrow Y and g:YZg:Y\rightarrow Z be functions.

  1. 1.

    If ff and gg are injective, so is gfg\circ f.

  2. 2.

    If ff and gg are surjective, so is gfg\circ f.

  3. 3.

    If ff and gg are bijective, so is gfg\circ f.

Proof.
  1. 1.

    Suppose ff and gg are injective. To show that gfg\circ f is injective, we need to show that if ... (with x,xXx,x^{\prime}\in X), then ... .

    So, suppose x,xXx,x^{\prime}\in X satisfies .... Then g(f(x))=g(f(x))g(f(x))=g(f(x^{\prime})). Since gg is ... , this means ... . Since ff is ... this implies ... , as desired.

    This completes the proof that gfg\circ f is injective.

  2. 2.

    Now suppose ff and gg are surjective. To show that gfg\circ f is surjective, we need to show that for all ... , there is some ... such that ... .

    Let zZz\in Z. Since gg is ... , there is some ... such that ... . Since ff is ... , there is some xXx\in X such that ... . Then

    ...

    as desired.

    This finishes the proof that gfg\circ f is surjective.

  3. 3.

    If gg and ff are bijective, then they are both injective and surjective, so by the previous two parts, gfg\circ f is also both injective and surjective, hence gfg\circ f is bijective.

Task 5.16 (15 mins).

(B3.2.2) In your supplementary material for this task you’ve been given a theorem and its proof which has been split into blocks.

  1. 1.

    Represent this theorem pictorially.

  2. 2.

    Rearrange the blocks into a coherent proof of the theorem. Are there any steps you are not convinced by? Discuss these with your group.

  3. 3.

    Compare each line of the proof of part (a) with the line in the proof of part (b) in the same position. In what ways are they similar? In what ways are they different and why?

  4. 4.

    How do we know there exist distinct x1,,xnx_{1},\ldots,x_{n} in block 5.15?

  5. 5.

    If YY is the image of ff, is it possible for |X|<|Y||X|<|Y|?

  6. 6.

    EXTENSION: Find counterexamples that show the converse of the statements in this theorem are not true in general.

Theorem.

Let XX and YY be finite sets and let f:XYf:X\rightarrow Y be a function.

  1. a)

    If ff is injective, then |X||Y||X|\leq|Y|.

  2. b)

    If ff is surjective, then |X||Y||X|\geq|Y|.

  3. c)

    If ff is bijective, then |X|=|Y||X|=|Y|.

5.10.

Since YY is finite, we can list its elements as y1,,ymy_{1},\ldots,y_{m} where m=|Y|m=|Y|.

5.11.

If ff is injective, then the elements f(x1),,f(xn)f(x_{1}),\ldots,f(x_{n}) are distinct.

5.12.

Therefore there are exactly mm elements in the set A={x1,,xm}A=\{x_{1},\ldots,x_{m}\}.

5.13.

Since XX is finite, we can list its elements as x1,,xnx_{1},\ldots,x_{n} where n=|X|n=|X|.

5.14.

Since this is a subset of YY, the set YY must have at least as many elements as BB, so |Y|n=|X||Y|\geq n=|X|.

5.15.

If ff is surjective, then for each i=1,,mi=1,\ldots,m, we can choose distinct xiXx_{i}\in X such that f(xi)=yif(x_{i})=y_{i}.

5.16.

Since this is a subset of XX, the set XX must have at least as many elements as AA, so |X|m=|Y||X|\geq m=|Y|.

5.17.

This follows by combining results (a) and (b).

5.18.

Therefore there are exactly nn elements in the set B={f(x1),,f(xn))}B=\{f(x_{1}),\ldots,f(x_{n}))\}.

Definition (Countable and uncountable sets).

A set SS is said to be countable if it is finite or if there is a bijection from \mathbb{N} to SS.

An infinite countable set is said to be countably infinite.

A set that is not countable is said to be uncountable.

Task 5.17 (15 mins).

(B3.2.3) In your supplementary notes, you’ve been given a claim, its proof and a corollary.

  1. 1.

    Read the claim, proof and corollary. Identify the key steps of showing a function is bijective in the given proof.

  2. 2.

    In the argument that ff is surjective, why do we consider the cases where mm is negative and non-negative instead of positive and negative?

  3. 3.

    Write out the values of f(1)f(1), f(2)f(2), f(3)f(3), f(4)f(4), f(5)f(5) and try to spot a pattern.

  4. 4.

    Write a proof for the corollary.

  5. 5.

    Think of an infinite subset AA of \mathbb{N}. Find a bijective function from AA to \mathbb{N}. What conclusions can you make from this?

  6. 6.

    EXTENSION: Find other definitions or theorems which we can use to immediately conclude corollaries after another result.

Claim.

Consider the function f:f:\mathbb{N}\to\mathbb{Z} which is defined by:

f(n)={n2if n is even,n12if n is odd.f(n)=\begin{cases}-\frac{n}{2}&\text{if $n$ is even,}\\ \frac{n-1}{2}&\text{if $n$ is odd.}\end{cases}

The function ff is bijective.

Proof.

For ff to be bijective, it needs to be both injective and surjective.

To show that ff is injective, we need to show that if f(n)=f(n)f(n)=f(n^{\prime}) for n,nn,n^{\prime}\in\mathbb{N}, then n=nn=n^{\prime}.

So, suppose n,nn,n^{\prime}\in\mathbb{N} such that f(n)=f(n)f(n)=f(n^{\prime}). Then, nn is either even or odd. If nn is even, then f(n)=n2=n2=f(n)f(n)=-\frac{n}{2}=-\frac{n^{\prime}}{2}=f(n^{\prime}). Rearranging, we get n=nn=n^{\prime} as desired.

Alternatively, if nn is odd, then f(n)=n12=n12=f(n)f(n)=\frac{n-1}{2}=\frac{n^{\prime}-1}{2}=f(n^{\prime}). Again, rearranging gives n=nn=n^{\prime}.

This completes the proof that ff is injective.

To show that ff is surjective, we need to show that for all mm\in\mathbb{Z}, there is some nn\in\mathbb{N} such that m=f(n)m=f(n).

Let mm\in\mathbb{Z}. If mm is non-negative, then we can take n=2m+1n=2m+1. Note that nn is an odd natural number so f(n)=2m+112=mf(n)=\frac{2m+1-1}{2}=m as desired.

On the other hand, if mm is negative, then we can set n=2mn=-2m. Then nn is an even positive number and hence a natural number. We have f(n)=2m2=mf(n)=-\frac{-2m}{2}=m.

Therefore ff is surjective.

As ff is both surjective and injective, it is bijective.

Corollary.

The set \mathbb{Z} is countable.

Task 5.18 (10 mins).

(B3.2.4) In your supplementary material, you were given a theorem and proof for this task.

  1. 1.

    Read the given theorem and proof. Are there any steps that you’re not convinced by? Discuss them with your group.

  2. 2.

    The proof never directly shows (ii) \Rightarrow (i). Why can we still conclude that (i) and (ii) are equivalent?

  3. 3.

    EXTENSION: Try proving the statements in this theorem in the other direction i.e. prove that (iii) \Rightarrow (ii), (ii) \Rightarrow (i) and (i) \Rightarrow (iii).

Theorem.

Let SS be any infinite set. The following are equivalent:

  1. (i)

    SS is countably infinite;

  2. (ii)

    there is a surjection from \mathbb{N} to SS;

  3. (iii)

    there is an injection from SS to \mathbb{N}.

Proof.

  1. (i) \Rightarrow (ii)

    If SS is countably infinite then, by definition, there is a bijection S\mathbb{N}\to S.

  2. (ii) \Rightarrow (iii)

    Suppose f:Sf:\mathbb{N}\to S is surjective. Then, for any xSx\in S, the set f1({x})f^{-1}(\{x\})\subseteq\mathbb{N} is nonempty and so has a unique smallest element, call it nxn_{x}. Then g:Sg:S\to\mathbb{N} defined by g(x)=nxg(x)=n_{x} is injective.

  3. (iii) \Rightarrow (i)

    Suppose h:Sh:S\to\mathbb{N} is injective. Then, since SS is an infinite set and no pair of elements in SS are mapped (under hh) to the same natural number, h(S)h(S) is an infinite subset of \mathbb{N} and is therefore countable.