1.4 Practice Problems

Problem 1.1. Let \(X=\Big \{\frac {1}{n}:n<5,\ n\in \mathbb {N}\Big \}\) and \(Y=\Big \{\frac {1}{n+2}:n<4,\ n\in \mathbb {N}\Big \}\). List the elements of \(X\cap Y\), \(X\cup Y\), \(X-Y\), \(X\bigtriangledown Y\) and \(X\times Y\).

Show solution

Solution. First write out the two sets. Taking \(\mathbb {N}=\{1,2,3,\dots \}\), the condition \(n<5\) gives \(n=1,2,3,4\), and \(n<4\) gives \(n=1,2,3\): \[X=\left \{1,\tfrac {1}{2},\tfrac {1}{3},\tfrac {1}{4}\right \},\qquad Y=\left \{\tfrac {1}{3},\tfrac {1}{4},\tfrac {1}{5}\right \}.\] Everything else is read off from these lists. \begin {align*} X\cap Y &=\left \{\tfrac {1}{3},\tfrac {1}{4}\right \}\\ X\cup Y &=\left \{1,\tfrac {1}{2},\tfrac {1}{3},\tfrac {1}{4},\tfrac {1}{5}\right \}\\ X-Y &=\left \{1,\tfrac {1}{2}\right \}\\ X\bigtriangledown Y &=(X-Y)\cup (Y-X) =\left \{1,\tfrac {1}{2}\right \}\cup \left \{\tfrac {1}{5}\right \} =\left \{1,\tfrac {1}{2},\tfrac {1}{5}\right \} \end {align*}

Finally \(X\times Y\) has \(4\times 3=12\) ordered pairs: \begin {align*} X\times Y=\Big \{&(1,\tfrac 13),(1,\tfrac 14),(1,\tfrac 15), (\tfrac 12,\tfrac 13),(\tfrac 12,\tfrac 14),(\tfrac 12,\tfrac 15),\\ &(\tfrac 13,\tfrac 13),(\tfrac 13,\tfrac 14),(\tfrac 13,\tfrac 15), (\tfrac 14,\tfrac 13),(\tfrac 14,\tfrac 14),(\tfrac 14,\tfrac 15)\Big \}. \end {align*}

Note that \(X\times Y\) is a set of pairs, not of numbers, and that \((1,\tfrac 13)\) and \((\tfrac 13,1)\) are different elements — the second is not in \(X\times Y\) at all.

Problem 1.2. If \(X\) and \(Y\) are any sets, prove that \(X-Y=X\cap Y^c\), and deduce that \(X\bigtriangledown Y=(X\cap Y^c)\cup (Y\cap X^c)\).

Show solution

Solution. For the first identity, every step is an equivalence: \begin {align*} x\in X-Y &\iff x\in X \ \text { and }\ x\notin Y\\ &\iff x\in X \ \text { and }\ x\in Y^c\\ &\iff x\in X\cap Y^c. \end {align*}

Hence \(X-Y=X\cap Y^c\).

For the second, apply the first identity twice. By definition \(X\bigtriangledown Y=(X-Y)\cup (Y-X)\), and \[X-Y=X\cap Y^c,\qquad Y-X=Y\cap X^c,\] the second by the same argument with \(X\) and \(Y\) interchanged. Substituting, \[X\bigtriangledown Y=(X\cap Y^c)\cup (Y\cap X^c).\]

Problem 1.3. Show that if \(X\subset Y\) then \(Y^c\subset X^c\).

Show solution

Solution. Let \(x\in Y^c\), so \(x\notin Y\). Suppose, for contradiction, that \(x\in X\). Since \(X\subset Y\), every element of \(X\) lies in \(Y\), so \(x\in Y\) — contradicting \(x\notin Y\). Therefore \(x\notin X\), that is \(x\in X^c\).

Since \(x\) was an arbitrary element of \(Y^c\), we conclude \(Y^c\subset X^c\). Taking complements reverses inclusions; it does not preserve them.

Problem 1.4. On the set \(\mathbb {R}[x]\) of all polynomials with real coefficients, define \(f\mathcal {R}g\) if and only if \(f'=g'\). Show that \(\mathcal {R}\) is an equivalence relation and describe its equivalence classes.

Show solution

Solution. All three properties follow from properties of equality of the derivatives.

i.
Reflexive. \(f'=f'\), so \(f\mathcal {R}f\).
ii.
Symmetric. If \(f'=g'\) then \(g'=f'\), so \(f\mathcal {R}g\) implies \(g\mathcal {R}f\).
iii.
Transitive. If \(f'=g'\) and \(g'=h'\) then \(f'=h'\), so \(f\mathcal {R}g\) and \(g\mathcal {R}h\) imply \(f\mathcal {R}h\).

For the classes: \(f'=g'\) means \((f-g)'=0\), and a polynomial with zero derivative is constant. So \(f\mathcal {R}g\) exactly when \(f-g\) is a constant, and \[[f]=\{f+c: c\in \mathbb {R}\}.\] Each class is a family of parallel curves, one for each value of the constant of integration — the classes are precisely what is being counted when an indefinite integral is written with a “\(+\,c\)”.

Problem 1.5. Let \(f:\mathbb {R}-\{0\}\rightarrow \mathbb {R}\) be given by \(f(x)=\frac {1}{x}\). Find \(f(A)\) where \(A=[-1,0)\cup (0,1]\), find \(f^{-1}(B)\) where \(B=[-2,-1]\cup [1,2]\), and determine whether \(f\) is bijective.

Show solution

Solution.

The image \(f(A)\)

On \((0,1]\), as \(x\) decreases from \(1\) towards \(0\) the value \(1/x\) increases from \(1\) without bound, so \(f\big ((0,1]\big )=[1,\infty )\). On \([-1,0)\) the same argument with signs reversed gives \(f\big ([-1,0)\big )=(-\infty ,-1]\). Hence \[f(A)=(-\infty ,-1]\cup [1,\infty ).\]

The inverse image \(f^{-1}(B)\)

We need every \(x\neq 0\) with \(1/x\in [-2,-1]\cup [1,2]\). For \(1\leq \frac 1x\leq 2\), taking reciprocals reverses the inequalities and gives \(\frac 12\leq x\leq 1\). For \(-2\leq \frac 1x\leq -1\) the same reasoning gives \(-1\leq x\leq -\frac 12\). Hence \[f^{-1}(B)=\left [-1,-\tfrac {1}{2}\right ]\cup \left [\tfrac {1}{2},1\right ].\]

Bijective?

\(f\) is injective: if \(\frac 1x=\frac 1y\) then \(x=y\). But \(f\) is not surjective onto \(\mathbb {R}\), because \(\frac 1x=0\) has no solution — \(0\) is not in the range. So \(f\) is not bijective as a map into \(\mathbb {R}\).

It is worth noticing that this is a defect of the stated codomain only: as a map \(\mathbb {R}-\{0\}\rightarrow \mathbb {R}-\{0\}\) the same rule is bijective, and is its own inverse.

Problem 1.6. Let \(f:X\rightarrow Y\) be a function with \(A\subset X\). Decide whether \(f(A^c)=\big (f(A)\big )^c\) is true in general. Give a proof or a counterexample, and state a condition on \(f\) under which it does hold.

Show solution

Solution. The statement is false in general.

A counterexample

Take \(f:\mathbb {R}\rightarrow \mathbb {R}\) with \(f(x)=x^2\) and \(A=[0,\infty )\). Then \(A^c=(-\infty ,0)\) and \[f(A^c)=\{x^2:x<0\}=(0,\infty ),\] while \(f(A)=[0,\infty )\) and so \(\big (f(A)\big )^c=(-\infty ,0)\). These two sets are not merely unequal — they are disjoint.

Why it fails

Two separate things go wrong. Because \(f\) is not injective, a value can be reached from both \(A\) and \(A^c\), so \(f(A)\) and \(f(A^c)\) may overlap; and because \(f\) is not surjective, a point of \(Y\) outside \(f(A)\) need not be in \(f(A^c)\) either, since it may not be in the range at all.

When it holds

If \(f\) is bijective, both objections vanish and the identity is true. Indeed, let \(y\in Y\) and let \(x\) be the unique point with \(f(x)=y\). Then \[y\in f(A^c)\iff x\in A^c \iff x\notin A \iff y\notin f(A)\iff y\in \big (f(A)\big )^c,\] where the third equivalence uses injectivity (no other point maps to \(y\)) and the existence of \(x\) uses surjectivity.

Problem 1.7. Let \(f:X\rightarrow Y\) and \(g:Y\rightarrow Z\) be functions. Prove that if \(f\) and \(g\) are both injective then \(g\circ f\) is injective, and that if both are surjective then \(g\circ f\) is surjective.

Show solution

Solution.

Injective

Suppose \((g\circ f)(x)=(g\circ f)(y)\), that is \(g(f(x))=g(f(y))\). Since \(g\) is injective, \(f(x)=f(y)\). Since \(f\) is injective, \(x=y\). Hence \(g\circ f\) is injective. Note the order: \(g\)’s injectivity is used first, on the outside.

Surjective

Let \(z\in Z\). Since \(g\) is surjective there is \(y\in Y\) with \(g(y)=z\). Since \(f\) is surjective there is \(x\in X\) with \(f(x)=y\). Then \[(g\circ f)(x)=g(f(x))=g(y)=z,\] so every \(z\in Z\) is attained and \(g\circ f\) is surjective.

Problem 1.8. Let \(f:X\rightarrow Y\) and \(g:Y\rightarrow Z\) be bijective. Show that \(g\circ f\) is invertible and that \((g\circ f)^{-1}=f^{-1}\circ g^{-1}\).

Show solution

Solution. By the previous problem \(g\circ f\) is both injective and surjective, hence bijective, so by Theorem 1.3.8 it has an inverse.

To identify that inverse it is enough to check that \(f^{-1}\circ g^{-1}\) composes with \(g\circ f\) to give the identity on both sides. Using associativity of composition and \(g^{-1}\circ g=I_Y\), \begin {align*} (f^{-1}\circ g^{-1})\circ (g\circ f) &=f^{-1}\circ (g^{-1}\circ g)\circ f =f^{-1}\circ I_Y\circ f =f^{-1}\circ f=I_X, \end {align*}

and symmetrically \begin {align*} (g\circ f)\circ (f^{-1}\circ g^{-1}) &=g\circ (f\circ f^{-1})\circ g^{-1} =g\circ I_Y\circ g^{-1} =g\circ g^{-1}=I_Z. \end {align*}

Hence \((g\circ f)^{-1}=f^{-1}\circ g^{-1}\).

The reversal of order is the point of the result, and it is not a quirk of notation: to undo “put on socks, then shoes” you must take off the shoes first.

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.