4.3 Proving two sets are equal

You may have previously used Venn diagrams to indicate that two sets are equal. While they can be useful for your understanding of what is going on, these do not constitute stringent proofs in themselves.

The most common method to directly prove that two sets AA and BB are equal to each other is to first show that ABA\subseteq B and then show that BAB\subseteq A. If both of these are true, we must have A=BA=B.

Exercise 4.25.

Why does showing that both ABA\subseteq B and BAB\subseteq A mean that we necessarily have A=BA=B?

Solution (please try for yourself before looking)

If ABA\subseteq B then for every element aAa\in A, aBa\in B.

Moreover, if BAB\subseteq A, then every bBb\in B also has bAb\in A.

As every element of AA is therefore in BB and vice versa, then A=BA=B.

To show one set AA is a subset of another set BB, we can take a general element of AA and show that it must also belong to BB. This is the strategy we use in the next proof.

Theorem 4.26 (De Morgan’s Laws).

Let AA and BB be two sets, then

  1. a)

    (AB)c=AcBc(A\cup B)^{c}=A^{c}\cap B^{c},

  2. b)

    (AB)c=AcBc(A\cap B)^{c}=A^{c}\cup B^{c}.

Proof (of Theorem 4.26 a)).

To prove (AB)c=AcBc(A\cup B)^{c}=A^{c}\cap B^{c}, we first show that (AB)cAcBc(A\cup B)^{c}\subseteq A^{c}\cap B^{c} and then show that AcBc(AB)cA^{c}\cap B^{c}\subseteq(A\cup B)^{c}.

Let x(AB)cx\in(A\cup B)^{c}. Then, by definition of the complement, xABx\notin A\cup B. As xx is not an element of AA or BB, then we must have that xAx\notin A and xBx\notin B. Equivalently, xAcx\in A^{c} and xBcx\in B^{c} so xx belongs to an intersection of two sets AcA^{c} and BcB^{c} i.e. xAcBcx\in A^{c}\cap B^{c}. Hence, we’ve shown that any element x(AB)cx\in(A\cup B)^{c} is also an element of AcBcA^{c}\cap B^{c} so (AB)cAcBc(A\cup B)^{c}\subseteq A^{c}\cap B^{c}.

To show AcBc(AB)cA^{c}\cap B^{c}\subseteq(A\cup B)^{c}, consider an element yAcBcy\in A^{c}\cap B^{c}. Then

yAcBc\displaystyle y\in A^{c}\cap B^{c}\quad
\displaystyle\iff yAc and yBc\displaystyle y\in A^{c}\text{ and }y\in B^{c}\quad by definition of intersection
\displaystyle\iff yA and yB\displaystyle y\notin A\text{ and }y\notin B by definition of complement
\displaystyle\iff yAB\displaystyle y\notin A\cup B by definition of union
\displaystyle\iff y(AB)c\displaystyle y\in(A\cup B)^{c} by definition of complement.\displaystyle\text{ by definition of complement}.

We have therefore shown that AcBc(AB)cA^{c}\cap B^{c}\subseteq(A\cup B)^{c}. As we have also seen that (AB)cAcBc(A\cup B)^{c}\subseteq A^{c}\cap B^{c}, then we must have (AB)c=AcBc(A\cup B)^{c}=A^{c}\cap B^{c}.

In the proof above, the argument that (AB)cAcBc(A\cup B)^{c}\subseteq A^{c}\cap B^{c} is written in a different style to the argument that AcBc(AB)cA^{c}\cap B^{c}\subseteq(A\cup B)^{c}. Both styles are valid but we would usually stick to one style throughout the same proof.

If we look at this proof carefully, we notice that the equivalence of the statements within it actually reduce the proof to the following (much shorter) argument:

Proof.

Observe that

yAcBc\displaystyle y\in A^{c}\cap B^{c}\quad
\displaystyle\iff yAc and yBc\displaystyle y\in A^{c}\text{ and }y\in B^{c}\quad by definition of intersection
\displaystyle\iff yA and yB\displaystyle y\notin A\text{ and }y\notin B by definition of complement
\displaystyle\iff yAB\displaystyle y\notin A\cup B by definition of union
\displaystyle\iff y(AB)c\displaystyle y\in(A\cup B)^{c} by definition of complement.\displaystyle\text{ by definition of complement}.

Hence, yAcBcy(AB)cy\in A^{c}\cap B^{c}\iff y\in(A\cup B)^{c} and thus, (AB)cAcBc(A\cup B)^{c}\subseteq A^{c}\cap B^{c} and AcBc(AB)cA^{c}\cap B^{c}\subseteq(A\cup B)^{c}. Therefore, (AB)c=AcBc(A\cup B)^{c}=A^{c}\cap B^{c}.

Exercise 4.27.

Using the proof of part a) as a guide, prove part b) of Theorem 4.26.

Note that the order in which we show one set is a subset of the other doesn’t matter: we could swap the second and third paragraph in the previous proof and it would remain logically consistent.

Exercise 4.28.

Consider the following sets

S\displaystyle S ={n:n=a2b2, for some a,b},\displaystyle=\{n\in\mathbb{Z}:n=a^{2}-b^{2},\text{ for some }a,b\in\mathbb{Z}\},
O\displaystyle O ={n:n is odd},\displaystyle=\{n\in\mathbb{Z}:n\text{ is odd}\},
F\displaystyle F ={n:n is divisible by 4}.\displaystyle=\{n\in\mathbb{Z}:n\text{ is divisible by }4\}.

Prove that S=OFS=O\cup F.

Solution (please try for yourself before looking)

We first show SOFS\subseteq O\cup F. Let nn be an arbitrary element of SS so n=a2b2=(a+b)(ab)n=a^{2}-b^{2}=(a+b)(a-b) for some a,ba,b\in\mathbb{Z}.

If aba-b is even then there is some kk\in\mathbb{Z} such that ab=2ka-b=2k. Moreover, a+b=(ab)+2b=2k+2b=2(k+b)a+b=(a-b)+2b=2k+2b=2(k+b) is also even and n=(ab)(a+b)=(2k)(2(k+b))=4k(k+b)n=(a-b)(a+b)=(2k)(2(k+b))=4k(k+b). This means nn is divisible by 4 so nFn\in F and, more generally, nOFn\in O\cup F.

If aba-b is odd, then for some kk\in\mathbb{N}, ab=2k+1a-b=2k+1 and a+b=2(k+b)+1a+b=2(k+b)+1. The product of two odd numbers is itself odd so we have nOn\in O and nOFn\in O\cup F.

In either case, nOFn\in O\cup F meaning SOFS\subseteq O\cup F.

We next prove the inclusion OFSO\cup F\subseteq S. Let mm be any element of OFO\cup F.

If mOm\in O, then m=2k+1m=2k+1 for some kk\in\mathbb{Z} and we can write this as a difference of two squares: 2k+1=(k1)2k22k+1=(k-1)^{2}-k^{2}. Therefore mSm\in S.

If mFm\in F, then mm is a multiple of 4 so m=4km=4k for some kk\in\mathbb{Z}. Consider (k+1)2(k1)2=4k=m(k+1)^{2}-(k-1)^{2}=4k=m. As we can write mm as the difference of two squares, then we again have mSm\in S.

In either case, mSm\in S meaning OFSO\cup F\subseteq S.

Overall, we have shown both OFSO\cup F\subseteq S and SOFS\subseteq O\cup F so can conclude that S=OFS=O\cup F.