Problem Set 1


Due Friday, July 5 at 5:30 pm Pacific


Solutions are available!

🔑 Solutions


Here we are – the first problem set of the quarter! This problem set is designed to give you practice writing proofs on a variety of different topics. We hope that this problem set gives you a sense of what proof-based mathematics is like and helps solidify your understanding of set theory.

Before you start this problem set, please do the following:

  • Review the Guide to Proofs for information about common proofwriting techniques.
  • Review the Guide to Partners for information about how to work effectively in a pair.
  • Review the Guide to Office Hours for information about how office hours work.
  • Review the Guide to $\LaTeX$ to learn how to typeset your solutions with $\LaTeX$.
  • Review the Proofwriting Checklist for a detailed set of criteria you should apply to your proofs before submitting them. We will be running this same checklist on your proofs when grading, so please be sure to look over it before submitting!
  • Review the Guide to $\in$ and $\subseteq$ to make sure you understand the distinction between these terms.

As always, please feel free to call into office hours or post on EdStem if you have any questions. We're happy to help out.

Good luck, and have fun!

Starter Files

You will need to download and set up this Qt Creator project to complete the first two problems on this problem set:

📩 PS1 Starter Files

Unpack the files somewhere convenient and open up the bundled project.

As a reminder, you are required to type your solutions to this problem set. If you would like to type your solutions in $\LaTeX$, you may want to download this template file where you can place your answers:

🖋 PS1 $\LaTeX$ Template

You are also free to use Microsoft Word, Google Docs, etc. to type up your solutions.

Problem One: Much Ado About Nothing

It can take a bit of practice to get used to the empty set. This problem will ask you to think about a few different sets related to $\emptyset$.

Answer each part of this question by editing the file MuchAdoAboutNothing.sets in the res/ directory of the starter files. There’s information in the top of each of the files about how to represent sets; most importantly, note that to write out the empty set, you should write {} rather than using the empty-set symbol. For example, the set $\Set{\emptyset}$ would be written as { { } }.

  1. Give a set equal to $\emptyset \cup \Set{\emptyset}$.

  1. Give a set equal to $\emptyset \cap \Set{\emptyset}$.

  1. Give a set equal to $\Set{\emptyset} \cup \Set{\Set{\emptyset}}$.

  1. Give a set equal to $\Set{\emptyset} \cap \Set{\Set{\emptyset}}$.

  1. Give a set equal to $\wp(\wp(\emptyset))$.

  1. Give a set equal to $\wp(\wp(\wp(\emptyset)))$.

The starter code contains a driver program you can use to see the contents of your files and run tests to check your answers. Submit your answers through GradeScope under “Coding Problems for Problem Set One” by uploading your edited files. You’re welcome to submit as many times as you’d like; we’ll count as your grade the last version of the uploaded files.

Problem Two: Set Theory in C++

The C++ standard library contains a type called std::set that represents a set of elements, all of which must be of the same type. For example, the type std::set<int> represents a set of integers, the type std::set<std::string> represents a set of strings, and std::set<std::set<int>> is a type representing a set of sets of integers.

There are all sorts of operations you can perform on std::sets. For example, here’s how you iterate over all the elements of a set:

std::set<T> mySet;
for (T elem: mySet) {
    /* 
 do something with the current element elem 
 */
}

Here’s how you check whether a particular value is an element of a set:

if (mySet.count(value)) {
    /* 
 value ∈ mySet 
 */
} else {
    /* 
 value ∉ mySet 
 */
}

And, finally, here’s how you can get the cardinality of a set:

size_t size = mySet.size();

Here, the size_t type is a type representing a natural number, since sets can’t have negative size. (The folks who designed the C++ standard libraries had a strong discrete math background.)

One of the major differences between the sets we’ve talked about in CS103 and the std::set type is that in discrete mathematics, sets can contain anything – numbers, philosophies, recipes, other sets, etc. – but in C++ all objects in a set must have the same type. For the purposes of this problem, we’ve created a custom C++ type called Object. Variables of type Object can represent just about anything, so a std::set<Object> represents something pretty similar to the sets we’ve been studying so far.

Some Objects are actually just std::sets in disguise. If you have an Object, you can test whether it’s actually a set by using this provided helper function:

bool isSet(Object o);

This takes in an Object, then returns true if that Object is actually a set and false otherwise. If you have an Object that really is a set, you can convert it to a set by using this helper function:

std::set<Object> asSet(Object o);

This function takes in an Object that you know happens to be a set, then returns the std::set<Object> that it actually is.

For example, suppose you have an Object that you know is really the set $\Set{1, 2, 3, 4}$. You could iterate over it using this code:

Object reallyASet = /* 
 */;
for (Object x: asSet(reallyASet)) {
    /* 
 do something with x 
 */
}

In this problem, we’d like you to demonstrate your understanding of sets and set theory by coding up a number of functions in C++ that operate on sets. In doing so, we hope that you’ll solidify your grasp of the distinctions between related concepts in set theory, such as the the $\in$ and $\subseteq$ relations and power sets.

Open the file SetTheory.cpp from the starter files. There, you’ll find a bunch of stubs of functions that you’ll need to implement. The provided starter code contains a test harness you can use to try out your functions. You won’t need to modify any of the other C++ files bundled with the starter code.

As with Problem One, you’ll submit the code that you write through GradeScope separately from the rest of the problems on this problem set. The GradeScope autograder will get back to you with feedback about how you’re doing on this problem, and you’re welcome to submit as many times as you’d like.

  1. Implement a function

    bool isElementOf(Object S, Object T);
    

    that takes as input two Objects $S$ and $T$, then returns whether $S \in T$.

    $S$ and $T$ might not be sets; you’ll need to use the isSet and asSet functions appropriately.

  1. Implement a function

    bool isSubsetOf(Object S, Object T);
    

    that takes as input an object $S$ and an object $T$, then returns whether $S \subseteq T$.

    $S$ and $T$ might not be sets; use the isSet predicate to check whether the appropriate arguments are sets and asSet to get a view of them as sets.

  1. Implement a function

    bool areDisjointSets(Object S, Object T);
    

    that takes as input two objects $S$ and $T$, then returns whether $S$ and $T$ are sets where $S \cap T = \emptyset$. (Two sets with this property are called disjoint.) The input parameters $S$ and $T$ may or may not be sets, and if they aren’t, your function should return false.

  1. Implement a function

    bool isSingletonOf(Object S, Object T);
    

    that takes as input two objects $S$ and $T$, then returns whether $S = \Set{T}$. Again, $S$ and $T$ may or may not be sets.

  1. Implement a function

    bool isElementOfPowerSet(Object S, Object T);
    

    that takes as input two objects $S$ and $T$, then returns whether $S$ and $T$ are sets and $S \in \wp(T)$. Again, $S$ and $T$ may or may not be sets.

    As a hint, you shouldn’t need to write code that computes $\wp(T)$ explicitly. See if you can find a different way to do this.

  1. Implement a function

    bool isSubsetOfPowerSet(Object S, Object T);
    

    that takes as input two objects $S$ and $T$, then returns whether $S$ and $T$ are sets and $S \subseteq \wp(T)$. Again, $S$ and $T$ may or may not be sets.

  1. Implement a function

    bool isSubsetOfDoublePowerSet(Object S, Object T);
    

    that takes as input two objects $S$ and $T$, then returns whether $S$ and $T$ are sets and $S \subseteq \wp(\wp(T))$. Again, $S$ and $T$ may or may not be sets.

To submit your work, upload your edited SetTheory.cpp file to GradeScope. You’ll get immediate feedback on your score from our autograder, and you’re allowed to resubmit as many times as you’d like.

As a note, you shouldn’t edit SetTheory.h; our autograder will always use the default version of that file when running tests.

Problem Three: Describing the World in Set Theory

The notation of set theory (e.g. $\cup, \cap, \wp, \subseteq, \in, \emptyset, =,$ etc.) is a great tool for describing the real world. Answer each of the following questions by writing an expression using set theory notation, but without using plain English, without using set-builder notation, without introducing any new variables, and without using propositional or first-order logic (which we’ll cover next week). No justification is required.

  1. In the Talking Heads song Crosseyed and Painless, David Byrne speaks the following lines:

    “Facts are simple and facts are straight. Facts are lazy and facts are late.”

    Let $F$ be the set of all facts. Let $A$, $B$, $C$, and $D$ represent the set of all things that are simple, straight, lazy, and late, respectively. Write an expression that conveys David Byrne’s lyrics in the language of set theory.

    Once you’ve written up your answer to this problem, take a minute to type-check it. As an example, suppose that you have the following answer:

    \[(A \in B) \cap (A \in C).\]

    This expression can’t be correct, and here’s one way to see this. The expression $A \in B$ is of type Boolean – either $A \in B$ is true or it isn’t – and the same is true of $A \in C$. However, the intersection operator $\cap$ can only be applied to sets. The expression therefore contains a type error: it tries to apply an operator that only works on sets to Boolean values.

    You can type-check this answer in a different way. For example, suppose you came up with this expression:

    \[A \cup D.\]

    Here, $A$ and $D$ are sets, so it’s perfectly fine to write $A \cup D$, which evaluates to an object of type set. But notice that the statement here asks you to write an expression that says “Facts are simple and facts are straight. Facts are lazy and facts are late.” and that statement is of type Boolean (facts either have these properties or they don’t). Therefore, $A \cup D$ can’t possibly be an expression with the right meaning, since the type of the expression (set) doesn’t match the type of the statement (Boolean).

    If you’re having trouble with this problem, consider working backwards. You know that you need an expression that evaluates to type Boolean. What operations on sets do you have that produce Booleans? Or perhaps make the problem simpler. How would you say "all facts are simple?" How about "all facts are both simple and straight?"

  1. Suppose you’re on an exciting first date. Let $Y$ represent the set of all your hobbies and $D$ represent the set of all your date’s hobbies. Write an expression that says that you have at least one hobby that your date doesn’t have.

    As before, type-check your answer! Should your answer represent a set? A Boolean? Something else?

  1. Let’s say that a committee is a group of people, which we can think of as being represented by the set of people that comprise it. Let’s have $S$ represent the set of all students at Stanford and let $F$ represent the set of all faculty at Stanford. Write an expression representing the set of all committees you can make from Stanford students and faculty that contain at least one student and at least one faculty member. You can assume no one is both a student and a faculty member.

    Something to think about: how would you say “all committees made purely of students?” Something else to think about: what is the type of the statement to translate? Is it a Boolean? A set? Neither?

Problem Four: Proof Critiques

One of the best ways to improve your proof writing is to do some proof reading. In doing so, you’ll get a much better perspective on why certain stylistic conventions matter, both in the positive sense, (“wow, that’s so easy to read!”) and in the negative sense (“I can’t make heads or tails of this!”). You’ll also get practice tracing through mathematical arguments, which will help expand your repertoire of techniques and give you a better sense of what details to focus on in your own reasoning.

We’ve curated three proofs for you to review. Read these proofs, and for each one, do the following:

  • Critique its style. Our Proofwriting Checklist contains specific details to review in any proof. Go through the checklist one item at a time, identifying any style errors and explaining each.
  • Critique its reasoning. Are the arguments given by these proofs correct? If there are logic errors, point them out and demonstrate why they’re incorrect. Then, determine whether the theorem being proved is even true in the first place. After all, you can prove anything using faulty logic!

Complete the critique for each of the three proofs by filling out the table below:

Checklist Item Violation? If Yes, where is the error?
Clearly Articulate Assumptions and “Want-to-Shows.” Yes/No
Make Each Sentence Load-Bearing Yes/No
Scope and Properly Introduce Variables Yes/No
Make Specific Claims About Specific Variables Yes/No
Don’t Repeat Definitions; Use Them Instead Yes/No
Write In Complete Sentences and Complete Paragraphs Yes/No
Distinguish Between Proofs and Disproofs Yes/No
Avoid the “Contradiction Sandwich” Yes/No
Are there any logic errors? If so, where?
Is the overall theorem true?
  1. Critique this proof about parities (the parity of a number is whether it’s even or odd.)

    Theorem: The sum of an even integer and an odd integer is odd.

    Proof: This proof will talk about adding together different kinds of numbers. An even integer is an integer that can be written as $2k$ for some integer $k$. Therefore, $m = 2k$. Similarly, an odd integer is one that can be written as $2k+1$ for some integer $k$. So $n = 2k+1$. $m + n = 2k + 2k + 1 = 4k + 1$. Therefore $m + n$ is odd. ■

  1. Critique this proof about natural numbers.

    Theorem: Every natural number is odd.

    Proof: Assume for the sake of contradiction that every natural number is even. In particular, that would mean that $137$ is even. Since $137 = 2 \cdot 68 + 1$ and $68$ is a natural number, we see that $137$ is odd. We know that there is no integer $n$ where $n$ is both odd and even. However, $n = 137$ is both even and odd. This is impossible. We’ve reached a contradiction, so our assumption must have been wrong. Therefore, every natural number is odd. ■

  1. Critique this proof about modular arithmetic (see Problem 8 for how this new operation, modular congruence is defined!).

    Theorem: If $n$ is an integer and $n \equiv_2 0$, then $n \equiv_4 0$.

    Proof: We will prove the contrapositive of this statement and show that if $n$ is an integer where $n \equiv_4 0$, then $n \equiv_2 0$. Since $n \equiv_4 0$, we know $n = 0 + 4q$. This in turn tells us that $n = 2(2q)$, so there is an integer $m$ such that $n = 2m$. Consequently, we see that $n = 0 + 2m$, and so $n \equiv_2 0$, as required. ■

Problem Five: Writing Direct Proofs

It’s time to write your first proofs! Over the next three problems, we’ll walk you through three proofs of three different theorems. A key theme throughout these problems is

☞ the structure of a theorem dictates the structure of the proof. ☜

That is, the way the theorem is written gives the high-level structure of how the proof will be written. Indeed, you can make progress toward proving a theorem simply by “unpacking” the statement of the theorem to figure out what needs to happen and when.

In this problem, you will write a direct proof of this theorem:

Theorem: For all integers $n$, if $n$ is odd, then $n^2$ is odd.

For example, we see that $3$ is odd, and $3^2 = 9$ is odd as well.

Remember that the structure of a direct proof is dictated by the sentence structure of the theorem. In this case, our theorem looks like this:

\[\begin{aligned} &\text{For all integers }n, && \text{(a universally-quantified statement)} \\ &\quad\text{if }n\text{ is odd,} && \text{(the antecedent of an implication)} \\ &\quad\quad\text{then }n^2\text{ is odd.} && \text{(the consequent of an implication)} \end{aligned}\]

Take a look back at the Guide to Proofs, the slides from our lecture on mathematical proofs, or the Proofwriting Checklist, for a refresher about how to work with universally-quantified statements and implications.

We want to extract from the sentence structure of our theorem the two foundations of our direct proof. The first is the starting point of the proof, which we call the assume step. Here, you’ll pick an arbitrarily-chosen value meeting the requirements of the antecedent of the implication. The second is the destination of the proof, which we call the want-to-show step. Here, that’s the consequent of the implication.

It is important to note that the want-to-show is not the entire theorem, although that might seem like the obvious thing to say since you clearly do want to show it! Think of the pair as like a start and destination of driving directions, and want-to-show is just the name of the destination.

  1. Write the first sentence of this proof (the assume step).

    Ours start with the word “pick,” but there are other valid options listed in the Guide to Proofs and Proofwriting Checklist.

  1. Write the second sentence of this proof (the want-to-show step).

    Ours starts with the words “We want to show that
”

  1. Now complete the proof, using this template as a guide, and copying in the two sentences you wrote above. The sizes of the blanks are not necessarily to scale.

    Notice that the first two sentences of a direct proof follow mechanically from the structure of the theorem. The third sentence in this example is also illustrative of a very common pattern for third sentences, which is to expand a definition from the “assume” sentence (in this case, the definition of odd integers).

    Theorem: For any integer $n$, if $n$ is odd, then $n^2$ is odd.

    Proof: Pick $\blank$. We want to show that $\blank$. Since $n$ is odd, there is an integer $k$ where $\blank$. (Note: When following the direct proof guidelines, the first three sentences are fairly mechanical, but now we need to exercise actual creativity. It helps to look at our want-to-show to remind ourselves of our destination on this journey. It says we want to show something about $n^2$, so we will begin with the expression $n^2$, and then apply algebra to it.) Then we see that

    \[\begin{aligned} n^2 & = \blank \\ & = \blank \\ & = \blank. \end{aligned}\]

    Therefore, there is an integer $m$ (namely, $\blank$) such that $\blank$, so $\blank$ (write your “Want to Show” statement here to announce that you’ve proved it), as required. ■

  1. In the conclusion of the proof, the template has you using a variable named $m$ to show that $n^2$ is odd. The definition of odd integers from the lecture slides uses a variable $k$ for this purpose. Why did we choose $m$ here instead? Could we have used $k$?

Problem Six: Writing Proofs by Contrapositive

You’ve now written your first direct proof – great job! Let’s move on to our next proof technique, the proof by contrapositive. In this problem, you’ll use a proof by contrapositive to prove this theorem:

Theorem: For all integers $a$, $b$, and $c$, if $a^2 + b^2 = c^2$, then at least one of $a$, $b$, and $c$ is even.

Proof by contrapositive is another technique for theorems with a sentence structure that has the form of an implication. In fact, proof by contrapositive will proceed exactly like a direct proof, with similar “assume” and “want-to-show” steps, but will do so only after taking the contrapositive of the theorem to get a new, equivalent statement to prove.

  1. What is the contrapositive of the theorem?

    Since the “for all” part comes before the “if” that begins the implication, the “for all” part remains unchanged by taking the contrapositive. Be very careful how you negate the “at least one of.”

  1. Write the “assume” sentence of your proof, based on the antecedent of the contrapositive.

  1. Write the “want-to-show” sentence of your proof, based on the consequent of the contrapositive.

  1. Complete the proof, using this template as a guide, and copying in the two sentences you wrote above. As before, the sizes of the blanks are not necessarily to scale.

    Theorem: For any integers $a$, $b$, and $c$, if $a^2 + b^2 = c^2$, then at least one of $a$, $b$, and $c$ is even.

    Proof: We will prove the contrapositive of this statement, namely, $\blank$. To do so, pick $\blank$. We want to show that $\blank$.

    Since $a$, $b$, and $c$ are $\blank$, we know by our result from the previous problem that $a^2$, $b^2$, and $c^2$ are $\blank$.

    Because $a^2$ and $b^2$ are $\blank$, there exist integers $p$ and $q$ such that $\blank$. This means that $a^2 + b^2 = \blank = \blank$, which means that $a^2 + b^2$ is $\blank$.

    However, as mentioned earlier we know that $c^2$ is $\blank$. Therefore, we see that $\blank$ (write your “Want to Show” statement here to announce that you’ve proved it), as required. ■

In the above proof, we expanded the definition of odd for two values that we know are odd, $a^2$ and $b^2$. However, notice that we didn’t expand out the definition of odd for $c^2$, even though we know it’s an odd number. While factually it wouldn’t be incorrect to expand out what it means for $c^2$ to be odd, it would be have been stylistically incorrect, since doing so would violate one of the rules from the Proofwriting Checklist.

  1. What rule from the Proofwriting Checklist would have been violated if we had expanded out the definition of “$c^2$ is odd” in the above proof?

Problem Seven: Writing Proofs by Contradiction

We’ve just checked off direct proofs and proofs by contrapositive. That leaves us with proofs by contradiction, which are the focus of this problem.

Your task in this problem is to prove the following theorem:

Theorem: For all integers $m$ and $n$, if $mn$ is even and $m$ is odd, then $n$ is even.

When writing a proof by contradiction, in your “assume” step you’ll simply assume the negation of the theorem to prove.

  1. What is the negation of the above theorem?

Once you’ve written the “assume” state in a proof by contradiction, you won’t explicitly articulate a “want-t-show” the way you did for a direct proof or a proof by contrapositive. Rather, by simply informing the reader that you’re going to proceed by contradiction, you’re implicitly telegraphing “oh, and by the way, I’m going to find two contradictory facts that follow from this assumption.” Therefore, rather than explicitly stating a “want to show” sentence like you did in the previous proofs, you’ll simply start exploring from your assumption, then indicate once you’ve reached a contradiction.

  1. Fill in the blanks below to complete this proof by contradiction. As before, the relative sizes of the blanks are not necessarily indicative of how much you need to write.

    Theorem: For any integers $m$ and $n$, if $mn$ is even and $m$ is odd, then $n$ is even.

    Proof: Assume for the sake of contradiction that $\blank$. Since $m$ is $\blank$, we know that there is an integer $k$ where $\blank$. Similarly, since $n$ is $\blank$, there is an integer $r$ where $\blank$. Then we see that

    \[\begin{aligned} mn & = \blank \\ & = \blank \\ & = \blank, \end{aligned}\]

    which means that $mn$ is $\blank$, but this is impossible because $\blank$.

    We have reached a contradiction, so our assumption must have been wrong. Therefore, if $mn$ is even and $m$ is odd, then $n$ is even. ■

Problem Eight: Proving Mixed Universal and Existential Statements

This problem explores a style of proof in which we mix together universally-quantified and existentially-quantified statements. To do so, we’ll explore a concept called modular congruence.

Different numbers can yield the same remainder when divided by some number. For example, the numbers $1$, $12$, $23$, and $34$ all leave a remainder of one when divided by eleven. To formalize this relationship between numbers, we'll introduce a relation $\equiv_k$ that, intuitively, indicates that two numbers leave the same remainder when divided by k. For example, we'd say that $1 \equiv_{11} 12$, since both $1$ and $12$ leave a remainder of $1$ when divided by $11$, and that $8 \equiv_3 14$, since both $8$ and $14$ leave a remainder of $2$ when divided by $3$.

To be more rigorous, we'll formally define $\equiv_k$. If $k$ is an integer, we define $a \equiv_k b$ as follows:

We say that $a \equiv_k b$ when there exists an integer $q$ such that $a = b + kq$.

We’d read the statement “$x \equiv_k y$” aloud as “$x$ is congruent to $y$ modulo $k$.” For example, $7 \equiv_3 4$, because $7 = 4 + 3 \cdot 1$, and $5 \equiv_4 13$ because $5 = 13 + 4 \cdot (-2)$.

  1. Fill in the blanks to complete this direct proof about modular congruence.

    Theorem: For all integers $x$ and $y$ and any integer $k$, if $x \equiv_k y$, then $y \equiv_k x$.

    Proof: Let $x$, $y$, and $k$ be arbitrary integers where $x \equiv_k y$. We need to show that $y \equiv_k x$. To do so, we will show that there is an integer $q$ where $\blank$. (Notice that after stating our want-to-show as usual for a direct proof, we expanded the want-to-show to be more specific about what it means to show that. Now our want-to-show has the form of an existential (“
 there exists an integer $q$ 
”). This is an important structural trait to focus in on. It means that in the body of the proof, we are going to have to demonstrate that such a $q$ exists very concretely by proposing a specific value for $q$.)

    Because $x \equiv_k y$, we know there is an integer $r$ such that $\blank$. Now, pick $q = \blank$. (Here it is, our announcement of the value we are proposing for $q$. Next, we need to justify to the reader that our choice works. What follows is that justification. Always do it in this order: first announce the value, then justify.) Then we see that

    \[\begin{aligned} y & = \blank && \color{blue}{\textit{(Do not write } x + qk \textit { here; see below)}} \\ & = \blank \\ & = x + kq, \end{aligned}\]

    which is what we needed to show. ■

    As the note in the proof suggests, you must not start with the equation $y = x + qk$, and do algebra from there. The reason is that you do not know yet if that is true, and proofs must be a sequence of statements that are certain to be true. So you want to write something there that we already know is true, and use algebra to reach the last line as written.

  1. Prove for all integers $x$, $y$, $z$, and $k$ that if $x \equiv_k y$ and $y \equiv_k z$, we have $x \equiv_k z$.

  1. Prove for all integers $x$ and $k$ that $x \equiv_k x$.

    This proof will feel different from the previous problems because you aren’t assuming anything about $x$ or $k$ other than the fact that they’re integers. But the basic setup will feel the same: you’re searching for some choice of $q$ that makes some equality hold. Follow the general idea from earlier when structuring your proof: state, explicitly, what choice of $q$ you’re going to make, then prove that it has the right properties.

Problem Nine: Proofs on Sets

Earlier in this assignment, you explored the language of sets and set theory. On this problem, you'll see how to write proofs about sets.

One of the trickier details when writing proofs about sets is a disconnect between how we usually conceptualize sets and how proofs about sets actually work. When you think about sets at a high level, you typically think about "the collection of all items with some property" and think more holistically about what the items of the set look like. However, proofs about sets tend to instead focus more on individual elements of the sets and how they relate to one another.

Let's begin with an example. You're familiar with the notation $S \subseteq T$, which says that $S$ is a subset of $T$. The formal definition of $S \subseteq T$ is: If $S$ and $T$ are sets, then $S \subseteq T$ when for every $x \in S$, we have $x \in T$.

That means that to prove that $S \subseteq T$, the general pattern is the following:

  • Pick an arbitrary $x \in S$.
  • Prove that $x \in T$.

As an example, here's a proof that if $A \subseteq B$ and $B \subseteq C$, then $A \subseteq C$.

Theorem: For all sets $A$, $B$, and $C$, if $A \subseteq B$ and $B \subseteq C$, then $A \subseteq C$.

Proof: Pick any sets $A$, $B$, and $C$ where $A \subseteq B$ and $B \subseteq C$. We need to show that $A \subseteq C$. To do so, pick an $x \in A$; we'll prove that $x \in C$.

Since $A \subseteq B$ and $x \in A$, we know that $x \in B$. Similarly, since $x \in B$ and $B \subseteq C$, we know that $x \in C$, which is what we needed to show. $\qed$

Notice that this proof is essentially a story about an element $x$ and how it's contained in the different sets. Note that, in particular, we did not write the proof like this:

Theorem: If $A \subseteq B$ and $B \subseteq C$, then $A \subseteq C$.

(Incorrect!) Proof: Pick any sets $A$, $B$, and $C$ where $A \subseteq B$ and $B \subseteq C$. We need to show that $A \subseteq C$.

Since $A \subseteq B$, we know that $B$ contains all elements of $A$. And since $B \subseteq C$, we know that $C$ contains all elements of $B$. Therefore, $C$ contains all elements of $A$, so $A \subseteq C$. $\qed$

This proof might seem like it's intuitively on the right track, but because it doesn't focus on the specific definition of $A \subseteq C$, which is a universally-quantified claim about an object $x$, it isn't rigorous enough to establish the result.

  1. Fill in the blanks below to complete the following proof. As always, the relative sizes of the blanks does not necessarily indicate how much you need to write.

    Theorem: For all sets $A$, $B$, and $C$, if $A \subseteq B$ and $A \subseteq C$, then $A \subseteq B \cap C$.

    Proof: Let $A$, $B$, and $C$ be arbitrary sets where $\blank$. We need to show that $\blank$. To do so, pick an arbitrary $x \in $ $\blank$. We want to show that $x \in $ $\blank$.

    Since $\blank$ and $\blank$, we know that $x \in $ $\blank$. Similarly, since $\blank$ and $\blank$ we know that $x \in$ $\blank$. This means that $\blank$ and $\blank$, and so $x \in $ $\blank$, as required. $\qed$

  1. Fill in the blanks below to complete the following proof. As always, the relative sizes of the blanks does not necessarily indicate how much you need to write.

    Theorem: For all sets $A$, $B$, and $C$, if $A \subseteq C$ and $B \subseteq C$, then $A \cup B \subseteq C$.

    Proof: Let $A$, $B$, and $C$ be arbitrary sets where $\blank$. We need to show that $\blank$. To do so, pick an arbitrary $x \in $ $\blank$. We want to show that $x \in $ $\blank$.

    Since $\blank$, we know that either $x \in $ $\blank$ or $x \in $ $\blank$. We consider each case separately.

    Case 1: $x \in $ $\blank$. $\blank$.

    Case 2: $x \in $ $\blank$. $\blank$.

    In either case, we see that $\blank$, which is what we needed to show. $\qed$

Now that you have a bit more of a feel for what these proofs look like, let's introduce one more concept. Formally speaking, if $S$ and $T$ are sets, we say that $S = T$ if $S \subseteq T$ and $T \subseteq S$. In other words, two sets are equal if each is a subset of the other.

  1. Prove for all sets $A$ and $B$ that if $\powerset{A} = \powerset{B}$, then $A = B$.

Optional Fun Problem: Infinite Deviation

On each problem set, we'll provide at least one Optional Fun Problem. These are problems that can be solved purely using the techniques you’ve learned so far, but which will require more thought than the other problems on the problem set. Each problem, in our opinion, has a beautiful solution that will give you a much deeper understanding of core concepts, so we strongly encourage you to play around with them if you get the chance.

These Optional Fun Problems have no bearing on your grade. However, if you successfully complete at least one Optional Fun Problem on three or more of the problem sets this quarter, we'll send you a certificate attesting to that fact and saying how impressed we are. (These certificates carry no official weight with the university, but are something we could mention in a recommendation letter.)

As a matter of course policy, we don't provide any hints on the Optional Fun Problems – after all, they're supposed to be a challenge! However, we're happy to chat about them after the problem sets come due.

In our first class, we sketched a proof of Cantor’s theorem. This proof assumed there was a pairing between the elements of a set $S$ and the subsets of $S$, then constructed a set that was different in at least one position from each of the paired sets.

Show that, no matter how you pair the elements of $\mathbb{N}$ with the subsets of $\mathbb{N}$, there’s always at least one set $X \subseteq \mathbb{N}$ that differs in infinitely many positions from each of the paired sets. Justify your answer, but no formal proof is necessary.