on writing proofsgiven birth, and asks her husband, “is it a boy or a girl?” to which he...

47
SHAHED SHARIF ON WRITING PROOFS

Upload: others

Post on 22-Mar-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

S H A H E D S H A R I F

O N W R I T I N G P R O O F S

Page 2: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

Copyright © 2015 Shahed Sharif

CC© BY:© $\© C©

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 UnportedLicense. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ orsend a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

Page 3: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

Contents

1 Propositional Logic 5

1.1 Doctors and daleks 5

1.2 Conjunctions 7

1.3 Conditionals 10

1.4 Truth tables 13

1.5 Negation and logical equivalence 15

1.6 Biconditionals 17

1.7 For all and there exists 18

1.8 Logical deduction 22

2 Set theory 23

2.1 What is a set? 23

2.2 Subsets and set equality 28

2.3 Product, union, and intersection 29

2.4 Complements and set difference 35

2.5 Power set 38

2.6 Indexed sets 39

Interlude 43

12 Functions 45

Page 4: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a
Page 5: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

1 Propositional Logic

1.1 Doctors and daleks

A certain island in the middle of the Pacific Ocean is inhabited bytwo types of people, known as doctors and daleks. It is known thatdoctors always make true statements, while daleks always lie. Oneday, you visit the island and encounter three of the inhabitants: Azog,Bartholomew, and Cynthia. You ask Azog whether he is a doctor or adalek. The following conversation ensues:

Example 1.1.1.

azog: [mumbles inaudibly]1 1Both doctors and daleks are knownto mumble occasionally!

you: What did you say?bartholomew: He said that he’s a dalek.cynthia: Bartholomew lies!

The question is, who is a doctor and who is a dalek? Take a mo-ment to solve this problem.

U

The next few sections contain problems of this sort; that is, anumber of inhabitants make a number of statements, and basedon these statements, you must deduce something, usually who is adoctor and who is a dalek. There is always a straightforward wayof approaching these problems: try every possibility! In the aboveexample, Azog can be a doctor or a dalek, Bartholomew can be adoctor or a dalek, and Cynthia can be a doctor or a dalek, giving2 · 2 · 2 = 8 possibilities total.2 Most of these possibilities will make no 2A common error is to think that

there are 6 possibilities total. If youthought so, then you should list themall out.

sense, as you’d end up having a doctor making a false statement ora dalek making a true statement. As a simple example, consider thepuzzle

avery: Two plus two is five.belvedere: The sky is blue.

Since there are two people in the problem, there are 2 · 2 = 4potential solutions: Avery is a doctor and Belvedere is a doctor, Trying out every single option is known

as the brute force approach, and asyou can see from this last example,one should only use it as a last resort.Instead, make key observations toshorten your work.

Page 6: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

6 shahed sharif

Avery is a doctor and Belvedere is a dalek, Avery is a dalek andBelvedere is a doctor, or Avery is a dalek and Belvedere is a dalek.But clearly testing all 4 possibilities is a very slow way of solving theproblem!

Now let’s do Example 1.1.1.

Claim. Bartholomew is a dalek and Cynthia is a doctor. Azog’s type cannotbe determined.

Proof. If Azog were a doctor, then he could not say that he is adalek, for then he’d be lying. If Azog were a dalek, then again hecould not say that he is a dalek, for then he’d be telling the truth.Either way, Azog cannot have said that he is a dalek. ThereforeBartholomew’s statement is false, hence Bartholomew is a dalek, and Note that Bartholomew isn’t saying that

Azog is a dalek, but rather that Azogsays that Azog is a dalek.

Cynthia’s statement is true, hence she is a doctor. As for Azog, fromthe information given, there is no way of determining what he is.

Notice how we wrote this out: first, the answer under the label“Claim”, then the explanation with the label “Proof”. The end of theproof is marked with a box, called a tombstone.3 Proofs are the main 3Because you totally killed the

problem.subject of this course. You’ll notice immediately that the proof iswritten in complete sentences put together into a paragraph; thatis, a proof is a written form, like an essay, and should conform tothe usual standards for a properly written essay, including correctspelling and grammar. Additionally, the proof is written as a formal, There are many ingredients to a cor-

rectly written mathematical proof. Wewill discuss these ingredients in detailin the remainder of this course.

logical argument, where each statement is carefully explained.It is especially useful to state and prove helpful observations

which make future problems easier. Here is an example:Why “observation” and not “claim”?There’s no real difference—it’s justa matter of taste. In professionalmathematics, we typically use Theorem,Proposition, Corollary, and Lemma. Butlet’s not get ahead of ourselves!

Observation. An inhabitant of the island cannot make the statement, “I ama dalek.”

Proof. If a doctor made this statement, they would be lying, which isnot allowed. If a dalek made the statement, they would be telling thetruth, which is also not allowed. Therefore no inhabitant can makesuch a statement.

In the problems below, you should write out your answers in thesame format as I’ve done above.

Problems for Section 1.1

In all of the following, named characters are doctors or daleks. Remember that all answers should beexplained in complete sentences! Thegoal is clarity.

1. Suppose Adonis says, “I am a doctor.” What can you conclude?

2. Suppose you encounter Atman and Brahman.

atman: Brahman would say that I am a doctor.

Page 7: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

on writing proofs 7

brahman: That’s not true.

What can you conclude?

3. You meet Achilles and Bellerophon.

achilles: Bellerophon would say that I am a dalek.

bellerophon: Achilles would say that I am a doctor.

What can you conclude?

4. You encounter Ayumi, Bethesda, and Coco.

ayumi: Bethesda would say that Coco is a dalek.

bethesda: Coco would say that Ayumi is a dalek.

coco: Ayumi is a doctor.

You additionally know that at least one of the three is a doctor.What can you conclude?

5. You encounter Aragorn, Boromir, and Celeborn.

aragorn: Boromir would say that Celeborn is a dalek.

boromir: Aragorn is a dalek.

celeborn: Boromir would say that I am a dalek.

What can you conclude?

1.2 Conjunctions

Suppose Arjun makes the following statement:

Example 1.2.1.

arjun: I am a dalek and Bathsheba is a doctor.

What are Arjun and Bathsheba? This statement is an exampleof the conjunction AND. In order for the statement to be true, bothparts must be true; to be false, at least one part must be false. Thatmeans the first part is false, or the second part is false, or both arefalse. Consider the following examples:

1. The sky is blue and 2 + 2 = 4.

2. The sky is green and 2 + 2 = 4.

3. The sky is blue and 2 + 2 = 5.

4. The sky is green and 2 + 2 = 5.

Page 8: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

8 shahed sharif

Of these, the first is true, and the rest are false.Now we solve the problem.

Claim. Arjun and Bathsheba are both daleks.

Proof. Suppose Arjun is a doctor. Then both parts of his statementare true. But the first part of his statement is that he is a dalek, whichis the opposite of what we assumed. So Arjun must be a dalek. Thushis statement as a whole must be false. The first part of his statement,that he is a dalek, is true, so the second part must be false. ThereforeBathsheba is also a dalek.

Notice that making two separate statements is not the same asputting an AND between them; that is, if the puzzle were instead

Example 1.2.2.

arjun: I am a dalek. Bathsheba is a doctor.

then you’d have to say, “That’s impossible!” Why? Because Arjuncould never make the statement “I am a dalek.”

Try this puzzle:

Example 1.2.3.

annalee: Either I am dalek or Bijou is a doctor.

What are Annalee and Bijou? Here we have a different type ofconjunction: OR. The or in mathematics functions slightly differentlythan in conversational English in that it is true if one or both of theparts are true. Consider the following statements: If we want one thing to be true but

not both, we’d say so explicitly: “I amtall or I am shy, but not both.” This issometimes called exclusive or. Regularor is inclusive.

1. The sky is blue or 2 + 2 = 4.

2. The sky is green or 2 + 2 = 4.

3. The sky is blue or 2 + 2 = 5.

4. The sky is green or 2 + 2 = 5.

The first three are true, while the last one is false. There is a well-known joke about alogician and his wife. The wife has justgiven birth, and asks her husband, “Is ita boy or a girl?” to which he responds,“Yes.”

Claim. Both Annalee and Bijou are doctors.

Proof. If Annalee is a dalek, then the first part of her statement istrue, which is impossible. Therefore Annalee is a doctor. Since nowthe first part of her statement is false, the second part must be true.Therefore Bijou is a doctor as well.

Problems for Section 1.2

1. You meet Allen, Burroughs, and Corso.

Page 9: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

on writing proofs 9

allen: Burroughs and Corso are doctors.

burroughs: Either I or Allen is a dalek.

What can you conclude?

2. You meet Anand, Botvinnik, and Capablanca.

anand: Either Botvinnik is a dalek or Capablanca is a doctor.

botvinnik: Capablanca and I are both daleks.

What can you conclude?

3. You encounter Asia, Brussels, and Cuba.

asia: Cuba and I are both doctors.

brussels: Either Asia or Cuba is a dalek.

cuba: Asia and Brussels are both daleks.

What can you conclude?

4. You encounter Al, Bonnie, Clyde, and Dillinger. One of themis a dalek who stole a very valuable mathematical manuscript.Determine from their statements who is the thief.

al: Dillinger is the thief.

bonnie: At least one of us is a doctor.

clyde: At least one of us is a dalek.

dillinger: Both Bonnie and Clyde are doctors.

5. You meet Arkana, Bullard, Robin, and Corinthian.

arkana: Either Bullard is a doctor or Robin is a dalek.

bullard: Either Arkana or Corinthian is a dalek.

robin: At least one of the other three is a dalek.

What can you conclude?

6. You run into Agamemnon, Briseis, Cassandra, and Diomedes.

agamemnon: Briseis is a doctor and Cassandra is a dalek.

briseis: Cassandra is a dalek and Diomedes is a dalek.

cassandra: Either Agamemnon or Briseis is a dalek.

diomedes: Cassandra is a dalek or Agamemnon is a doctor.

What can you conclude?

Page 10: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

10 shahed sharif

1.3 Conditionals

A conditional is an if-then statement, such as Mathematics essentially consists of acollection of true conditionals.

• If it is raining, then the grass is wet.

• If the shape is a square, then it is a rectangle.

• If I sleep poorly, then I am tired in the morning.

• If n is an even prime, then n = 2.

• If you have great power, then you have great responsibility.

Grammatically, conditionals can be phrased in multiple ways:

• The grass is wet whenever it rains.

• Every square is a rectangle.

• I feel tired every time I sleep poorly.

• The only even prime is 2.

• Suppose you have great power. Then you also have great responsi-bility.

We consider the following situation:

Example 1.3.1.

ashika: If I am a doctor, then Burt is a dalek.

What are Ashika and Burt?Dealing with conditionals is considerable trickier than dealing

with conjunctions. The general conditional is in the form “If P thenQ,” where the P and Q stand for statements. In the above example,P is “Ashika is a doctor” and Q is “Burt is a dalek.” The questionis, what does it mean if the conditional is true? And what does itmean if the conditional is false? We demonstrate with a couple easierexamples.

Example 1.3.2. You are a bouncer at a bar. It is your job to make sureno one underaged is drinking. You see four people at the bar:

• an elderly man drinking water,

• an elderly woman drinking scotch,

• a young man drinking beer, and

• a young woman drinking soda.

Whose identification do you check?4 4You could of course just checkeveryone’s ID, but generally you wantto check the fewest number of people aspossible.

Page 11: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

on writing proofs 11

Try this now. The words printed below will wait patiently.

U

Okay, ready? This should be easy: just check the third person’s ID.Here, you are checking that the rule

If you are under 21, then your drink must be nonalcoholic.

is satisfied. There is only one situation which breaks this rule: some-one under 21 who is drinking an alcoholic beverage.

Going back to the general case, this implies that the statement “IfP then Q” is false when both P is true and Q is false, but is otherwisea true statement!

To illustrate this last observation, we consider the following state-ments:

1. If 2 + 2 = 4, then the sky is blue. One thing to observe about theseexamples is that in terms of logic,there’s no need for there to be a causalrelationship between the two parts of aconditional. That is, even though there’sabsolutely no reason in the world thatthe incorrect arithmetic statement2 + 2 = 5 should affect the color of thesky, the statement “If 2 + 2 = 5, then thesky is blue” is still considered true.

2. If 2 + 2 = 5, then the sky is blue.

3. If 2 + 2 = 5, then the sky is green.

4. If 2 + 2 = 4, then the sky is green.

Of these, the first three are true, and the last is false.

Example 1.3.3. Given the statement, “If it is raining, then the grass iswet”, what would have to be happening right now for the statementto be false? List all possibilities which make the statement false.

Now we are ready to do the doctors and daleks puzzle at the startof this section! We restate it here to refresh your memory:

ashika: If I am a doctor, then Burt is a dalek.

Claim. Ashika is a doctor and Burt is a dalek.

Proof. Ashika’s statement is in the form “If P then Q”, where P is“Ashika is a doctor” and Q is “Burt is a dalek”. If Ashika is a dalek,then P is false. But this makes the conditional true! As daleks cannotmake true statements, we must have that Ashika is a doctor. If Burt isa doctor, then P is true and Q is false, which would make the entireconditional false. Since Ashika’s statement is true, this cannot be.Therefore Burt is a dalek.

Definition 1.3.4. The converse of the conditional “If P then Q” is theconditional “If Q then P”.

A common error, in math and in life, is to think that a conditionalis the same as its converse. This is false!5 It turns out that a condi- 5This is important!

tional and its converse are independent; that is, both could be true,

Page 12: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

12 shahed sharif

both could be false, or one could be true and one could be false. Forexample, “If the shape is a square, then it is a rectangle” is true, but“If the shape is a rectangle, then it is a square” is false. Here are Did you notice that a conditional is not

the same as its converse?some more examples:

• “If he is a baby, then he cannot drive a car” vs. “If he cannot drivea car, then he is a baby.”

• “If your cooking is bad, then I will not eat it” vs. “If I do not eatyour food, then your cooking is bad.”6 6Maybe I’m just full, mom! I mean,

uh, hypothetically.• “If my roommate dumps a bucket of water on my head at 3 am,

then I wake up in the middle of the night” vs. “If I wake up inthe middle of the night, then my roommate must have dumped abucket of water on my head at 3 am.”

Notice that in each one of these examples, one of the statements istrue, but the other is false.

Problems for Section 1.3

1. Determine if the following statements are true or false.

(a) If this sentence is false, then it is true.

(b) If this sentence is true, then it is false.

2. Your friend has 4 cards, each of which has a letter on one side andan integer on the other. Your friend then makes the statement, “Ifthe letter is a vowel, then the number on the other side is even.”You want to check to see whether the statement is true or false.Suppose the 4 cards are lying on a table, and the sides visible toyou read

A N 4 7 .

Which cards do you turn over?7 7Similar to the bouncer problem, youwant to turn over the minimum numberof cards.3. You meet Asimov, Banks, and Clarke.

asimov: If Banks is a doctor, then Clarke is a dalek.banks: Both Clarke and I are daleks.

What can you conclude?

4. You encounter Anthony, Beauvoir, and Chisholm.

anthony: If I am a dalek, then Beauvoir is a dalek.beauvoir: Both Chisholm and I are daleks.chisholm: If I am a dalek, then Anthony is a doctor.

What can you conclude?

5. You encounter Allende, Borges, and Cervantes.

Page 13: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

on writing proofs 13

allende: If Borges is a doctor, then Cervantes is a dalek.

borges: Allende is a dalek.

cervantes: If Borges is a doctor, then I am a dalek.

What can you conclude?

6. You run into Avalanche, Blizzard, and Cyclone.

avalanche: If Blizzard is a doctor, then either I or Cyclone is adalek.

blizzard: If Avalanche is a dalek, then both I and Cyclone aredoctors.

cyclone: Both Avalanche and Blizzard are daleks.

What can you conclude?

7. Consider the conditional “If P then Q” and its converse. In thefollowing, you are asked to come up with an example P and Qwhich satisfies certain conditions. That means that you shouldchoose a specific statement for P (like “clowns are scary”8) and 8True fact.

a specific statement for Q in such a way that the condition issatisfied. One more twist: make sure your P and Q are not alwaystrue or always false, but depend on the situation.9 9“The sky is green” is bad, but “It

is raining” or “n is an odd number” isgood.(a) Come up with an example of P and Q which makes both state-

ments (i.e. the conditional and its converse) true; write downboth statements.

(b) Same question, but now both statements should be false.

(c) Same question, but now “If P then Q” is true and the converseis false.

(d) Same question, but now “If P then Q” is false and the converseis true.

1.4 Truth tablesTruth tables are used for clarity whenexplaining propositional logic, butnever appear in properly-writtenmathematical proofs. Thus if you getconfused about what a theorem orproblems says, for example, then it’s agood idea to write out a truth table foryourself on scratch paper.

So far we’ve taken two statements, P and Q, and combined them inthree different ways: P or Q, P and Q, and if P then Q. To summarizeour discussion, we can use truth tables.

Table 1.1 lists the four possible combinations of truth values forP and Q: both are true (T T), P is true and Q is false (T F), P is falseand Q is true (F T), or both are false (F F). In each case, one can lookat the third column to determine if the statement “P or Q” is true orfalse.

For example, suppose we want to determine if

The sky is green or coffee is the best beverage in the universe.

Page 14: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

14 shahed sharif

P Q P or Q

T T TT F TF T TF F F

Table 1.1: Truth table for OR.

is true or not. We have P is “the sky is green” and Q is “coffee is thebest beverage in the universe”. Since P is false and Q is true, we’re inthe third row of the table. The last entry is T, so the statement is true.

One can similarly check the truth tables for AND and conditionals.

P Q P and Q

T T TT F FF T FF F F

Table 1.2: Truth table for AND.

P Q If P then Q

T T TT F FF T TF F T

Table 1.3: Truth table for conditionals.

Truth tables can be used for much more complicated situations.For example, say we are looking at statements of the form “If P or Q,then R.”10 Under what conditions on P, Q, R is this statement true? 10Like: “If n is prime or negative,

then n is not a perfect square.”We can see the answer in Table 1.4.Notice that in this case, there are 2 · 2 · 2 = 8 possibilities.11 Also, 11There are 2 possibilities for each of

P, Q, and R.we put in a column for “P or Q” to help fill in the last column. Thefirst 3 columns come from Table 1.1, while the last 3 columns comefrom Table 1.3.

Problems for Section 1.4

1. Make a truth table for “If P and Q, then R.”

2. Come up with an example for each line of the truth table of “If Pand Q, then R.” That is, come up with an example where all of P,Q, and R are true; another where P and Q are true, but R is false;and so forth.

3. Make a truth table for “If P, then Q or R.”

Page 15: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

on writing proofs 15

P Q P or Q R If P or Q, then R

T T T T TT T T F FT F T T TT F T F FF T T T TF T T F FF F F T TF F F F T

Table 1.4: Truth table for “If P or Q,then R”.

1.5 Negation and logical equivalence

Definition 1.5.1. The negation of a statement P is a statement Q whosetruth value is always the opposite of the truth value of P. We oftenwrite Q as “not P” or ¬ P.

One way to think of negation is that if a dalek says P, then a doctorwould say ¬ P, and vice versa. Thus, the negation of “The sky isblue” is “The sky is not blue”. The negation of “n is even” is “n is noteven”.

Definition 1.5.2. Two statements are logically equivalent if their truth Two statements can be equivalentwithout being logically equivalent. Forexample, “The integer n is an evenprime” and “The integer n equals 2” areequivalent, but not logically equivalent.Why? The reason the two statementsare equivalent facts about n is that2 is the only even prime. This is amathematical fact. Logical equivalencemeans the two statements are the samewithout using external reasons. You canthink of logical equivalence as justrestating a sentence.

values are the same, regardless of the truth values of their constituentclauses.

For example, if we rephrase a complex statement in a simplerform, then we say the two forms are logically equivalent.

Example 1.5.3. Consider the two statements below:

• The integer n is not even or is not a perfect square.

• The integer n is not both even and a perfect square.

Without knowing the value of n, we can see that the two statementsare equivalent! There are four cases to check:

1. n is an even perfect square;

2. n is an odd perfect square;

3. n is even and not a perfect square; and

4. n is odd and not a perfect square.

It turns out12 that both statements are false in case 1, and true in 12You should check this yourself! Usea truth table if you want.every other case.

Example 1.5.4. Consider the two statements below:

Page 16: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

16 shahed sharif

• Zephyr is tall and a dalek.

• It is not true that Zephyr is short or a doctor.

Assuming that Zephyr lives on the island of doctors and daleks,these statements are also equivalent.13 13What are the four cases, and which

of them make the two statements true?These two examples are a special case of a general law:

Major mathematical results are calledtheorems. Slightly less important onesare called propositions.

Theorem 1.5.5 (DeMorgan’s Laws). Suppose P and Q are statements.

(a) “Not P and not Q” is equivalent to “Not ‘P or Q’ ”.

(b) “Not P or not Q” is equivalent to “Not ‘P and Q’ ”.

Proof of part (a). If P is true, then ¬ P is false, which makes “Not Pand not Q” false. But “P or Q” is also true, so “Not ‘P or Q’ ” is falseas well. Similarly, if Q is true, both statements are false.

Now suppose both P and Q are false. Then “Not P and not Q” iscertainly true. “P or Q” is false, so “Not ‘P or Q’ ” is true. Thus inthis case both statements are true.

As this covers all possible truth values for P and Q, the statementsmust be equivalent.

Alternate proof of part (a). We construct a truth table, Table 1.5, to This kind of proof is fine for proposi-tional logic, but the paragraph-style ispreferred since “proof by table” isn’t anoption in the rest of this text.

compare “Not P and not Q” with “Not ‘P or Q’ ”, and see that theyhave the same truth values in all cases. The claim follows.

P Q ¬ P ¬ Q P or Q ¬ P and ¬ Q Not (P or Q)

T T F F T F FT F F T T F FF T T F T F FF F T T F T T

Table 1.5: DeMorgan’s Law, part (a).

Problems for Section 1.5

For these problems, you do not need to prove your answers unlessexplicitly stated.1. The statement “Neither P nor Q” is logically equivalent to what

statement that we’ve already seen?

2. Rewrite each of the following statements into a logically equivalentstatement.14 14These should be grammatically

inequivalent.(a) She is either not blonde or not a mathematician.

(b) If it is raining, then the grass is wet.

(c) Whenever the sun is visible, it is daytime.

Page 17: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

on writing proofs 17

(d) The number x is not an odd perfect square.

3. Negate each of the statements in the previous problem.

4. Rewrite each of the following statements into a logically equivalentstatement.

(a) The jewel is either blue or shiny, but not both.

(b) If S does not have 4 sides, then it is not a square.

(c) The number x is prime, and it either ends in a 1 or is biggerthan 1000.

5. Negate each of the statements in the previous problem.

6. Show that conditionals are not logically equivalent to their con-verses by using a truth table.

7. Write out the truth table for “If not Q then not P”.

8. Prove part (b) of DeMorgan’s Laws in two different ways: with aproof written in paragraph form, and with a truth table.

9. The statement “If P then Q” is equivalent to a statement of theform “ or ”.

(a) Fill in the blanks, and prove your answer with either a proof inparagraph form or a truth table.

(b) Give an example of P and Q so that both statements above aretrue, and write down the corresponding statements.

(c) Now give an example where both statements are false.

10. Prove that “If P, then Q or R” is equivalent to “If P and not Q, thenR” without using a truth table.

1.6 Biconditionals

The last logical construction we cover is the biconditional. In the lastsection, we looked at logical equivalence. Biconditionals are more gen-eral: they give any kind of equivalence of statements. For example,the statements “n is an even prime” and “n equals 2” are equivalent.We can phrase this fact as

The integer n is an even prime if and only if n equals 2.

Definition 1.6.1. A biconditional is a statement of the form “P if andonly if Q”, which means “If P then Q and if Q then P”.

That means

The integer n is an even prime if and only if n equals 2.

is the same as saying

Page 18: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

18 shahed sharif

If n is an even prime then n equals 2; and if n equals 2 then n isan even prime.

In other words, a biconditional is the same as a conditional and itsconverse taken together. Table 1.6 gives the truth table for “P if andonly if Q”.

P Q If P then Q If Q then P P if and only if Q

T T T T TT F F T FF T T F FF F T T T

Table 1.6: Truth table for biconditionals.

Notice that “P if and only if Q” is true precisely when both P andQ have the same truth value. In other words, either both P and Q are This is why a biconditional is like say-

ing P and Q are equivalent statements.true, or both P and Q are false.

Proposition 1.6.2. The biconditional “P if and only if Q” is equivalent tothe statement “Either P and Q, or not P and not Q.”

Problems for Section 1.6

1. You meet Arcturus and Betelgeuse.

arcturus: I am a doctor if and only if Betelgeuse is a doctor.

What can you conclude?

2. You encounter Acidophilus, Bifidus, and Curd.

acidophilus: I am a dalek if and only if Bifidus is a doctor.

bifidus: Curd is a dalek.

curd: Acidophilus is a doctor.

3. You encounter Anchovy, Bacon, and Capsicum.

anchovy: Bacon is a doctor if and only if Capsicum is a doctor.

bacon: Either Anchovy or Capsicum is a dalek.

capsicum: Both Anchovy and I are doctors.

1.7 For all and there exists

Consider the statement

P: The integer n is a prime.

Page 19: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

on writing proofs 19

Is P true or false? Well, it depends on what n is, of course! State-ments like these are sometimes called open, meaning that they don’tby themselves have a truth value until you fill in the missing data(the value of n in this case). We sometimes write open statements infunctional notation: P(n). Then we can say, for example,

• P(2) is true,15 15We could also say “2 satisfies P”.

• P(4) is false, and

• P( 12 ) makes no sense.16 16In P, n is understood to be an

integer. A clearer example might betaking P of a shape, like P(triangle) forexample.

There are three common ways of turning an open statement into aregular statement. One you’ve already seen: just plug in a value!

The universal quantifier. The second way is using the universal quan-tifier, written ∀ or “for all”. Here’s an example with our P(n) from The symbol ∀ equivalently means “for

every” or “for each”.above:

∀ integers n, P(n).

Plain as day, right? Okay, here it is in English:

For every integer n, n is prime.

One can rephrase this to the logically equivalent statement

Every integer is prime.

which is obviously false (take n = 4). As one might guess, thequantifier means that no matter what value you plug in for n, P(n)should always be true. If you can find even a single exception, thewhole sentence “∀ integers n, P(n)” is false. Here are two moreexamples:

• ∀ integers n, 2n is even.

• ∀ rectangles R, R is a square.

The first one is true: when you multiply any integer by 2, the resultis always even. The second one is false: it’s certainly possible that agiven rectangle happens to be a square, but that’s not true for everyrectangle. Thus the statement as a whole is false.

Conditionals are often read with an invisible “for all” in front:

If n is prime, then n is odd.

is understood to mean

For all integers n, if n is prime, then n is odd.

The first sentence could be viewed as true if, say, we knew that n = 3.However, since the “for all” part is understood, the statement is false,since n = 2 is a prime which is not odd. This invisible universal quantifier is

why in practice, true conditionals dogive a causal relationship.

Page 20: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

20 shahed sharif

The existential quantifier. A third method is to use an existentialquantifier. We use the symbol ∃, which means “there exists”. Theconstruction looks like

∃n such that P(n). “There exists” is always followed byeither “such that” or “for which”; theyboth mean the same thing. A logicallyequivalent construction is “P(n) forsome n.” Never just say “There existsn.”

or

∃n for which P(n).

The statement is true if there is at least one n for which the conditionP(n) holds. For example,

• ∃ a prime number n such that n is even. There is an equivalent phrasing using“for some”: n is even for some primenumber n, or n is a perfect square forsome prime number n. Either way isfine.

• ∃ a prime number n such that n is a perfect square.

The first one is true, since n = 2 works. Notice that n = 3 is a primewhich is not even, but this does not affect the truth of the statement;we only need a single n which works. The second statement is false,as no prime number can be a perfect square; that is, we cannot findeven a single prime n for which the condition holds.

When writing a proof, if the condition after “such that” is suffi-ciently difficult, then you need to provide a reason for the existence.For example,

∃n such that n is prime and n + 2 is prime.17 17Hmm: I wonder how many n thereare with this property?

is not exactly obvious. In this case, one could simply add

For example, take n = 3.

Negating quantifiers. Notice that to make a universally quantified(∀) statement false, we just need a single example which makes itfalse. This suggests that the negation of a universal statement is anexistential one. Similarly, for an existential to be false, it means thatthe statement is false for every single choice of element. This suggeststhat the negation of an existential statement is a universal one.

Example 1.7.1. For each of the following pairs of statements, one is trueand the other false. I highly recommend spending five

minutes with each of these pairs ofstatements to understand why one isthe negation of the other. Don’t try tounderstand these mechanically; reallytry to understand what it would meanfor the first sentence to be false.

• The negation of “∀ integers n, 2n is even” is “∃ an integer n suchthat 2n is odd.”

• The negation of “∀ rectangles R, R is a square” is “∃ a rectangle Rsuch that R is not a square”.

• The negation of “∃ a prime number n such that n is even” is “∀prime numbers n, n is odd.”

• The negation of “∃ a prime number n such that n is a perfectsquare” is “∀ prime numbers n, n is not a perfect square”.

Page 21: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

on writing proofs 21

Using “let”. A common pitfall is misuse of the word “let”. “Let”means that you are introducing the thing immediately following:

Let n be an integer.

This construction most frequently comes up when assigning a vari-able name, as in the example above. If the object being named hasspecial properties, one pairs the “let” with a “such that”:

Let x be a real number such that x > 0. Of course, “Let x be a positive realnumber” is better.

As in the case of existential operators, if it’s not clear why you canfind something with the given special property, you must provide areason:

Let x be a real number such that x > 0. Let y be a real numbersuch that y2 = x. Since x > 0, such a y exists.

Problems for Section 1.7

1. Discuss the difference between the following statements.

(a) ∀ people x, ∃ a person y such that y is the true love of person x.

(b) ∃ a person x such that ∀ people y, x is the true love of person y.

2. Restate the following sentences using quantifiers.

(a) There’s someone for everyone.

(b) People who live in glass houses should not throw stones.

(c) The pen is mightier than the sword.

(d) One man’s trash is another man’s treasure.

3. Determine which of the following statements is true. Remember toprove your answers! The way to understand these is to do a

few examples. That is, if the statementsays “∃ a real number x such that P(x)”,then choose a specific real number xand see if the statement P(x) is trueor not. Do this for a few choices of x,and then decide if P(x) is ever true. Infact, if you’re stuck, my first questionwould be, “Did you try some specificexamples?”

(a) ∃ a real number x such that x2 − 3x = −2.

(b) ∃ a real number x such that x2 − 2x = −3.

(c) ∃ a real number x such that x3 − x + 1 = 0.

(d) ∀ real numbers x, x2 + 2x + 2 ≥ 1.

(e) ∀ real numbers c, ∃ a real number x such that x2 = c.

(f) ∀ real numbers c, ∃ a real number x such that x2 − 3x = c.

(g) ∀ real numbers c, ∃ a real number x such that x2 − 3x = c2.

4. Determine which of the following statements is true.

(a) ∀ real numbers x, y, y2 ≥ x− 2.

(b) ∃ real numbers x, y such that y2 + x3 = 0.

Page 22: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

22 shahed sharif

(c) ∃ a real number x such that ∀ real numbers y, x ≤ y.

(d) ∃ a natural number x such that ∀ natural numbers y, x ≤ y.

(e) ∀ real numbers c, ∃ real numbers a, b such that a2 + b2 = c2.

(f) ∀ natural numbers c, ∃ real numbers a, b such that a2 + b2 = c2.

(g) ∀ natural numbers c, ∃ natural numbers a, b such that a2 + b2 =

c2.

1.8 Logical deduction

Logical deduction is the process of putting together a number ofstatements which are known to be true to deduce new true state-ments. All logical arguments, not just mathematical ones, ideallystart from some premises, or things which are assumed to be true, and

One of the amazing things aboutmathematics is that, compared to everyother subject, there are extremely fewpremises. In fact, mathematicianshave written down the premises forthe entire subject of mathematics;these premises are often called axioms.Axioms come in groups, dependingon the subject matter: Euclid’s axiomsfor plane geometry, for example, or theZermelo-Fraenkel-Cantor axioms for settheory. Note however that axioms arenot set in stone; they have evolved, andcontinue to evolve, based on debateswithin the mathematical community.

proceed via logical deduction to conclusions. There are certain rulesfor logical deduction; one is that if we know the statements

If P then Q.

and

If Q then R.

are true, then we also know

If P then R. The ancient Greeks came up withnames for the various types of de-duction. The term for this particulardeduction is syllogism.

These rules are generally pretty clear, so I omit any further discussionof them.

Page 23: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

2 Set theory

2.1 What is a set?

A set is essentially a collection of things. These things can be num- Set theory is actually quite complicated,and in certain situations you have to bevery careful about what is considereda set. However this is a fairly raresituation.

bers, functions, people, symbols, geometric objects, or even othersets.

Definition 2.1.1. Let S be a set. If x is one of the objects in the setS, we say x is an element or member of S, and write x ∈ S. We also It is important to understand the

grammar of the symbol ∈: to the leftis an object, like a number, and to theright is a set. The thing on the right of∈ must be a set.

say S contains the element x, or x lies in S. If x is not an element of S,we write x /∈ S. Two sets are the equal if they have exactly the sameelements.

If S is the set of all even integers, we have 2 ∈ S, 4 ∈ S, 5 /∈ S, and“hot dogs” /∈ S.

A fundamental problem in mathematics is that of description or rep-resentation. The problem is this: we have some kind of mathematicalobject that we’d like to study,1 but before we can study it, we need 1Say, the circumference of a circle of

diameter 1.to figure out how to write it down, or talk about it.2 That problem2Say, with a Greek letter.

appears now: how do we describe a set?

2.1.1 How to describe a set

There are three ways of doing this:

List all the elements. We do this by writing down everything in theset between curly braces ({, }), and putting a comma in betweenconsecutive elements:

• {1} is the set with a single element, the number 1.

• {coffee, ice cream, beer, raspberries, rice} is a set containing someof my favorite things to eat and drink. Not all at the same time!

• {{1}, {coffee, ice cream, beer, raspberries, rice}} is the set contain-ing exactly 2 elements; namely, each of the previous sets.

• {} is the set containing nothing, also called the empty set.

Page 24: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

24 shahed sharif

At this point, I should tell you two important facts about sets: repe-tition doesn’t matter, and order doesn’t matter. That means that thesets

{1, 2, 3} {1, 2, 1, 1, 3, 2} {3, 3, 3, 3, 3, 3, 3, 2, 1}

are all the same set. In other words: two sets A and B aredifferent if you can find some x whichis an element of A but not an elementof B, or vice versa. In this case, 1 is inall three sets, 2 is in all three, and 3 isin all three, and there’s nothing else toworry about.

There’s a major problem with this representation of sets: if thereare a lot, even infinitely many elements in the set, it can be hard towrite them all down! Fortunately, we can use the magic of ellipses:3

3Better known as “dot dot dot”.• {1, 2, 3, . . . , 10} is the set of integers from 1 to 10.

• {2, 4, 6, . . . , 20} is the set of even integers from 2 to 20.

• {2, 4, 6, . . . } is the set of all positive even integers.

• {. . . ,−4,−2, 0, 2, 4, 6, . . . } is the set of all even integers.

Essentially, the . . . says, “You know what I mean”, or if you prefer,“Yadda yadda yadda”.

You’re probably saying now, “Wow, writing down sets is so easy!This is going to be a short chapter.” Okay, smarty-pants—figure outwhat these sets are:

• {3, 5, 7, . . . }.

• {o, t, f, s, e, . . . }.

While you’re mulling over these, try going the other way: write downthe following sets in list form.

• The set of all real numbers.4 4We’ll get back to this example nearthe end of this course.

• The set of people currently on Earth.

• The set of people who have exactly one red-headed sibling.

• The set of all even numbers which can be written as the sum oftwo primes.5 5If you are familiar with Goldbach’s

conjecture, reward yourself with acoffee, ice cream, beer, raspberries, orrice.

• The set of all example sets in this section, including this one.

Now let’s do the sets from earlier. The first one is just the odd primenumbers, while the second is the first letters of all of the integers(one, two, four, . . . ). This highlights a major defect of the list repre-sentation of a set: it might be hard to guess what the set really is! Forthe second set of problems, we have another issue: the elements aretoo hard to list in any meaningful way.

Page 25: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

on writing proofs 25

Give the set a special name. Some sets come equipped with specialnames or symbols, and you can just refer to them with these. Forexample:

• N means the set of natural numbers; that is, {1, 2, 3, 4, . . . }.

• Z means the set of all integers. Numbers in German is Zahlen.

• Q means the set of rational numbers; that is, all fractions wherenumerator and denominator are whole numbers.

• R means the set of all real numbers.

• C means the set of all complex numbers.

• ∅ means the empty set {}, the set containing nothing.

In calculus, you also learned interval notation:

• (a, b) means all x ∈ R which satisfy a < x < b.

• [a, b) means all x ∈ R which satisfy a ≤ x < b.

• (a, b] means all x ∈ R which satisfy a < x ≤ b.

• [a, b] means all x ∈ R which satisfy a ≤ x ≤ b.

Use set-builder notation. The clearest way to list a set is with set-builder notation. There are two related versions of this notation. Thefirst is in the form

{x of a certain well-understood type | condition on x}.

The vertical bar is read “such that”. The condition gives a totally Some texts use a colon instead of avertical bar.explicit test to determine if a given x is in the set or not. Indeed, if

you are asked for the definition of a set6, then that means you should 6You will need to ask yourself thisextremely often.look at the set-builder notation, and specifically the condition part of

it. Some examples:

1. {x ∈ Z | x is even}

2. {x ∈ R | x > 0}

3. {x ∈ R | x2 − 1 = 0}

4. {x ∈ R | x2 + 1 = 0}

5. {x ∈ Z | ∃n ∈ Z such that x = 2n} As you might guess, quantified state-ments come up frequently in definitionsof sets.6. {x ∈ R | 3 ≤ x < 5}

7. {x ∈ R | ∀y ∈ R, x > y}

Page 26: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

26 shahed sharif

What are these sets?7 The way to understand these sets is to take x of 7In other words, find a more succinctdescription of these sets.the type to the left of the vertical bar and see if the condition on the

right is true or not for x. If it is true, then x is in the set. If it is false,then x is not in the set. The first example is clear: it is the set of evennumbers. We check x = 2; since 2 is even, the condition holds, and 2is in the set. We check x = 5; since 5 is not even, the condition doesnot hold, and 5 is not in the set.

Similarly, the second example is the set of positive real numbers.The third is the set {−1, 1}. The fourth is empty—there are no realnumbers which satisfy the equation. The fifth uses the existentialquantifier, and is in fact also the set of all even numbers. Take x = 2.The question is then does there exist an integer n such that 2n = x, orin other words 2n = 2? The answer is yes (n = 1), so 2 is in the set.Now try x = 3. Does there exist an integer n such that 2n = 3? Theanswer is no: only n = 3

2 works, but this is not an integer. Therefore 3is not in the set. The sixth example is the interval [3, 5).

The last example is the empty set! Take x = 1. Is it true that forevery real number y, that x > y? Of course not—just take y = 2! Nowtry x = 100. Is it true that for every real number y, that x > y? No—now take y = 101. The condition is saying that x is bigger than everyreal number; but we know that there is no such number. Therefore For the general case, given any x, we

can always choose y = x + 1, whichforces x < y.

the set is empty.The second version of set-builder notation is

{algebraic expression which lies in the set |condition that (parts) of the expression must satisfy}.

Examples:

• {2n | n ∈ Z}

• {2n | n is an even integer}

• {x2 | x ∈ R, x < −1}

The first set is the set of all even integers. We can let n be any integer,so let’s try n = 1. Then the expression on the left is 2 · 1 = 2, so 2 is inthe set. We can also let n = 2, which makes 2n = 4, and we see that 4is in the set.

The second set is all integer multiples of 4 (why?), and the last setis the interval (1, ∞). This last is the set of squares of all numberssmaller than −1; for example, (−1.5)2, (−2)2, and (−10)2 all lie inthis set.

2.1.2 Cardinality

Definition 2.1.2. If a set S consists of finitely many elements, then wesay S is a finite set. Otherwise we say S is an infinite set. If S is finite,

Page 27: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

on writing proofs 27

the cardinality of S is the number of elements in S. If S is infinite, wesay that its cardinality is infinite. The cardinality of S is denoted #S. Many texts use the notation |S| for

cardinality. However, this is terriblenotation since | · | is used for a multitudeof different things.

The cardinality of {1, 2, 3} is 3. If S = {2, 4, 6, . . . , 20}, then #S = 10.If S = ∅, then #S = 0. Note that the cardinality of a finite set isalways a nonnegative integer. There are such things as infinite car-

dinalities; we will discuss some basicconcepts in the theory later in thiscourse.Problems for Section 2.1

1. Write the following sets in list form. You do not have to prove youranswers.

(a) {2n + 1 | n ∈ Z}

(b) {2n + 1 | n ∈ Z and 3 ≤ n ≤ 6}

(c) {x ∈ R | x2 + 3x + 2 = 0}

(d) {x ∈ R | x2 + 3x + 2 = 0 and x ≥ 0}

(e) {x ∈N | x and x + 3 are prime}

(f) {3n | n ∈N}

2. Identify the following sets. Remember to prove your answers!

(a) {n ∈ Z | n2 ∈ Z}

(b) {x ∈ R | ∃y ∈ R such that y2 = x}

(c) {n ∈N | n2 + n− 2 < 0}

(d) {x ∈ R | ∃b ∈ Z such that bx ∈ Z}

(e) {x ∈ R | ∃b ∈ Q such that bx ∈ Z}

3. Write the following sets in set-builder notation. You may not useany words in your description beyond “and”, “or”, and “suchthat”. You do not have to prove your answers.

(a) {5, 6, 7, 8, 9}

(b) {5, 6, 7, . . . , 999}

(c) [2, 10)

(d) {. . . ,−5,−2, 1, 4, . . . }

4. Write the following sets in set-builder notation. You may not useany words in your description beyond “and”, “or”, and “suchthat”. You do not have to prove your answers.

(a) {10, 100, 1000, 10000, . . . }

(b) {. . . , 14 , 1

2 , 1, 2, 4, 8, . . . }

(c) {1, 4, 9, 16, . . . }

Page 28: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

28 shahed sharif

(d) {3, 6, 11, 18, . . . }(e) {11, 18, 27, 38, . . . }

5. Determine the cardinality of each of the sets below.

(a) {n ∈ Z | −2 ≤ n ≤ 10}(b) {r ∈ Q | 0 ≤ r ≤ 0.00001}(c) {n ∈ Z | 10 ≤ n ≤ 100 and n is odd}(d) {n ∈N | n ≤ 1000 and n is a multiple of 3}(e) {r ∈ Q | r · π ∈ Q}

2.2 Subsets and set equality

Definition 2.2.1. Given two sets A and B, we say that A is a subset of Learn this definition. Memorize it ifyou have to. Otherwise you will beunable to do any problems requiringyou to prove that one set is a subset ofanother. The same holds for every singledefinition you see from here on out.

B if for every a ∈ A, we have a ∈ B. In this case, we write A ⊂ B.

The grammar of ⊂ is that the symbolson both sides must represent sets.

One way of thinking of subsets is one takes some of the elementsof B, but not necessarily all, and uses only these elements to make A.

Given a set B, the empty set ∅ is always a subset of B. Also, B itselfis a subset of B.8 Thus, most sets have at least two subsets.

8Some texts use A ⊆ B to mean Ais a subset of B, and reserve A ⊂ B tomean that A is a subset of B, but is notallowed to be B itself. That is, A mustbe strictly smaller than B.

Example 2.2.2. Let A = {1, (2, 3), {4, 5}}. We have the following:

• 1 ∈ A

• 1 6⊂ A

As you might guess, 6⊂ means “is not asubset of”.

• {1} ⊂ A

• 2 /∈ A

• {2} 6⊂ A

• {(2, 3)} ⊂ A

• {4} 6⊂ A

• {4, 5} ∈ A

• {{4, 5}} ⊂ A

• {1, {4, 5}} ⊂ A

Frequently you will need to show that one set is a subset of an-other. How do you do this? In this course9, the answer to that kind of 9And in mathematics more gener-

ally.question is almost always contained in the definitions of the two sets.We will do an example in the next section.

We mentioned before that two sets are equal if they consist of ex-actly the same elements. In practice, we use the following propositionto prove set equality.

Proposition 2.2.3. Let A and B be sets. If A ⊂ B and B ⊂ A, then A = B.You will be using this proposition a lotin this chapter. Note that the converseof this proposition is also true.

Page 29: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

on writing proofs 29

Proof. Recall that the only way for two sets to be unequal is if thereis some element in one set which is not in the other. If there is somex ∈ A but x /∈ B, then we’d conclude that A 6⊂ B by definition ofsubset—but we in fact are given that A ⊂ B! Similarly if we had somex ∈ B but x /∈ A, then we’d have B 6⊂ A, which is contrary to ourassumption that B ⊂ A. Therefore A = B.

Problems for Section 2.2

1. Let R = {rectangles} and S = {squares}. Determine if R ⊂ S.

2. Let E = {2n | n ∈ Z} and P = {n ∈ Z | n is prime}. Prove thatE 6⊂ P and P 6⊂ E.10 10This is a two-part problem!

3. In each of the following, you are given two sets A and B. Deter-mine if A ⊂ B, B ⊂ A, both, or neither.

(a) A = {1, 2}, B = {2}

(b) A = ∅, B = R

(c) A = {{1, 2}, 3}, B = Z

(d) A = {c ∈ R|∃a, b ∈ R such that a2 − b2 = c}, B = R

4. Suppose A, B, and C are sets with A ⊂ B and B ⊂ C. Prove thatA ⊂ C.

5. Suppose A and B are finite sets with A ⊂ B. What can you sayabout #A and #B? You do not have to prove your answer.

6. A set A has exactly one subset. What can you say about A?

7. Determine which of the following statements is true.

(a) ∃n ∈N such that ∀X ⊂N, n ≥ #X.

(b) ∃X ⊂N such that ∀n ∈N, n ≥ #X.

2.3 Product, union, and intersection

Definition 2.3.1. Given sets A and B, the Cartesian product A× B is Have I mentioned that you should learnall definitions?the set of all ordered pairs (a, b) where a ∈ A and b ∈ B. Symboli-

cally,A× B = {(a, b) | a ∈ A and b ∈ B}.

For example, if A = {1, 2} and B = {x, y, z}, then

A× B = {(1, x), (1, y), (1, z), (2, x), (2, y), (2, z)}.

Note that #(A× B) = 6. Also,

B× A = {(x, 1), (y, 1), (z, 1), (x, 2), (y, 2), (z, 2)}.

Page 30: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

30 shahed sharif

Thus, A× B 6= B× A.If there are more than two sets, say n sets, we can define the

Cartesian product to be the set of n-tuples11, where each entry in 11A tuple is a finite ordered list. Un-like sets, order and repetition matter fortuples. An n-tuple is a list of length n.You’ll note that 2-tuples are called pairs,3-tuples triples, and so forth.

each tuple comes from the corresponding set. For example, if n = 3and we have three sets A, B, C, then

A× B× C = {(a, b, c) | a ∈ A, b ∈ B, and c ∈ C}.

Note that A× B× C, A× (B× C), and (A× B)× C are not technicallythe same set! The first consists of ordered triples. The second consistsof ordered pairs of the form (a, (b, c))—that is, the first entry in theordered pair is an element of A, and the second entry is an elementof B× C.12 12Now describe elements of the third

product yourself.Lastly, if the sets in a Cartesian product are all the same, then weoften use exponential notation. For example, A× A would be writtenA2, and A× A× A would be written A3.

Example 2.3.2. The set R can be represented graphically as the numberline. The set R2 = R×R is the set of ordered pairs (x, y) of realnumbers; it can be represented graphically as the coordinate plane.In high school algebra, you learned how to graph functions. Really, itturns out, you are graphically representing sets. For example, the set

L = {(x, y) ∈ R2 | y = x + 1}

is a subset of R2 which can be represented by the picture below.

−3 −2 −1 1 2 3

−2

2

Definition 2.3.3. Let A and B be sets. The union of A and B is the set

{x | x ∈ A or x ∈ B}.

It is written A ∪ B.

For example, if A = {1, 2, 3} and B = {3, 4, 5}, then A ∪ B =

{1, 2, 3, 4, 5}. Just as with Cartesian product, we can take the union ofmultiple sets: A ∪ B ∪ C for example.

Page 31: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

on writing proofs 31

Example 2.3.4. Let For B, one should technically say thatx ∈ [−1, 1], but since the universe is R2,this isn’t strictly necessary.

A =

{(x, 1) | x2 − 1

4= 0

},

B = {(x, y) | y = −√

1− x2}, and

C =

{(cos t,

12

sin t)∣∣∣∣− π ≤ t ≤ 0

}.

Since A, B, C ⊂ R2, we can graph these sets. In particular, the setA ∪ B ∪ C is drawn below.

−2 −1 1 2

−2

−1

1

2

Recall that in the previous section we discussed proving one set isa subset of another. We now give an example.

Proposition 2.3.5. Let A and B be sets. Then A ⊂ A ∪ B.

Proof. According to the definition of subset, we must show that forevery a ∈ A, that a ∈ A ∪ B. We do this now. Suppose we are givensome a ∈ A. To show that a ∈ A ∪ B, by definition of union weneed to show that a ∈ A or a ∈ B. But we know that a ∈ A, hencea ∈ A ∪ B.

Here’s a slightly harder one:

Proposition 2.3.6. Suppose A, B, C are sets and that A ⊂ B. ThenA ⊂ B ∪ C.

Proof. Suppose that a ∈ A. Since A ⊂ B, by definition of subset wesee that a ∈ B as well. By the previous proposition, we conclude thata ∈ B ∪ C. Since this reasoning holds for every a ∈ A, by definition ofsubset A ⊂ B ∪ C.

Definition 2.3.7. Suppose A and B are sets. The intersection of A andB, written A ∩ B, is

{x | x ∈ A and x ∈ B}.

Page 32: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

32 shahed sharif

Notice that intersection is like union, but with OR replaced withAND. Intuitively, the intersection of two sets are all the elements heldin common. For example, if A = {1, 2, 3, 4} and B = {2, 4, 6, 8}, thenA∩ B = {2, 4}. If C = A× B, then A∩C = ∅.13 Just as with Cartesian 13The set C consists of ordered pairs

of integers, while A consists of integers,so there is nothing in common.

product and union, one can take the intersection of multiple sets.

Example 2.3.8. Let

A =

{(x, 1) | x2 − 1

4= 0

},

B ={(x, y) | y ≥ −

√1− x2, |x| ≤ 1

}, and

C =

{(x, y) | y ≤ −1

2

√1− x2, |x| ≤ 1

}.

Then A ∪ (B ∩ C) is given by

−2 −1 1 2

−2

−1

1

2

Definition 2.3.9. If A and B are sets with A ∩ B = ∅, we say that Aand B are disjoint.

Informally, disjoint means that the sets have no elements in com-mon.

Problems for Section 2.3

1. Suppose A is a set. Compute the following. You don’t have toprove your answers.

(a) A×∅

(b) A ∪∅(c) A ∩∅(d) A ∪ (∅∩∅)

(e) (A ∪∅) ∩∅

Page 33: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

on writing proofs 33

2. Suppose A = {1, 2} and B = {2, 3}. Write out the following sets inlist form. You don’t have to prove your answers.

(a) ((A ∪ B) ∪ B) ∪ B

(b) A× B

(c) A2

(d) A× (B ∩ A)

(e) (A× B) ∩ A

(f) (A× A) ∩ A

(g) A ∪ (B× A)

(h) (A ∪ B)× A

(i) A ∩ (B× A)

(j) (A ∩ B)× A

3. Graph the following subsets of R2. You don’t have to prove youranswers.

(a) R× {1, 2} If you’re confused, write out a fewelements of each set.(b) R×Z

(c) Z×R

(d) [1, 2]× [−1, 1] (This is interval notation.)

(e) [1, 2]2

(f) {1, 2}2

(g) [1, 2]×R

(h) Z× {−1, 1}(i) Z× (−1, 1)

4. Graph the following subsets of R2. You don’t have to prove youranswers.

(a) {(x, y) | y− x2 = 0}

(b) {(x, y) | 1− x2 − y2 ≥ 0}

(c) {(x, y) | x2 − 1 = 0}

(d) {(x, x) | x ∈ R}

(e) {(cos t, sin t) | t ∈ [0, π/2]}

(f) {(x, y) | x + y = −1}

(g) {(x, y) | x + y ∈ Z}

5. Is R2 ⊂ R3?

6. Let A, B, and C be as in Example 2.3.8. Graph the following. Youdo not need to prove your answers.

Page 34: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

34 shahed sharif

(a) (A ∪ B) ∩ C.

(b) (A ∩ B) ∪ C.

(c) (A ∪ C) ∩ B.

(d) (A ∩ C) ∪ B.

7. Write the set given graphically below as a union and intersectionof “simple” sets. You don’t have to prove your answer.

−2 −1 1 2

−1

1

2

3

8. Determine which of the following statements is true.

(a) ∃X ⊂N such that ∀Y ⊂N, X ∪Y = N.

(b) ∃X ⊂N such that ∀Y ⊂N, X ∩Y = N.

(c) ∀X ⊂N, ∃Y ⊂N such that X ∩Y = ∅ and X ∪Y = N.

9. Suppose A and B are finite sets with #A = m and #B = n.

(a) What is #(A× B)?

(b) Suppose r ∈N. What is #(Br)?

10. Suppose that A and B are finite sets.

(a) Show by example that #(A ∪ B) does not necessarily equal#A + #B. You need to explain why your example

works; that is, calculate the appropriatecardinalities and show that the relevantequality does not hold.

(b) Suppose #(A ∪ B) = #A + #B. What can you conclude?

11. Suppose A, B, and C are sets.

(a) Prove that (A ∪ B) ∪ C = A ∪ (B ∪ C). This property is of course called associa-tivity. When an operation is associative,we can remove the parentheses entirely;e.g. A ∪ B ∪ C.

(b) Prove that (A ∩ B) ∩ C = A ∩ (B ∩ C).

12. If A, B, and C are sets, prove the following.

(a) (A ∩ B) ∪ (A ∩ C) = A ∩ (B ∪ C)

Page 35: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

on writing proofs 35

(b) (A ∪ B) ∩ (A ∪ C) = A ∪ (B ∩ C)

13. Suppose A and B are sets. Prove that A ∩ B ⊂ A ∪ B.

14. Let A, B, and S be sets. Prove that A ⊂ S and B ⊂ S if and only ifA ∪ B ⊂ S.

15. Let A, B, and S be sets.

(a) Prove that if S ⊂ A and S ⊂ B, then S ⊂ A ∩ B.

(b) Show by example that the converse is false.

16. Show by example that it is possible for A ∩ B ∩ C = ∅, but thatnone of the pairs of sets amongst the three is disjoint. (That is, Aand B are not disjoint, B and C are not disjoint, and A and C arenot disjoint.)

17. Suppose A and B are sets, and that A ⊂ A ∩ B. What can youconclude?14 14If you’re thinking, “How the heck

should I know?”, then I highly recom-mend doing out several examples. Thatis, choose different pairs of sets A andB, and test to see if A ⊂ A ∩ B holds ornot. Then try to see if there is a patternto the cases where equality does hold.Remember: you are expected to proveyour answer unless explicitly statedotherwise.

18. Suppose A and B are sets, and that A ∪ B ⊂ A. What can youconclude?

19. Suppose that A and B are sets, and that A ∩ B = A ∪ B. What canyou conclude?

2.4 Complements and set difference

Definition 2.4.1. If A and B are sets, then the set difference A− B is Some texts use the notation A \ B.

{x | x ∈ A and x /∈ B}.

This means we start with everything in A, but then throw out allof those things which happen to be in B.

Example 2.4.2. Let A = {chocolate, strawberries, mold, cake, garbage,dirt, ice cream} and B = {mold, garbage, dirt}. Then A− B should bethe set consisting of only the yummy things from A.

Example 2.4.3. Let A = {1, 2, 3}, B = {3}, C = {3, 4, 5}, and D = ∅.Then

• A− B = {1, 2},

• A− C = {1, 2}, and

• A− D = {1, 2, 3}.

Notice that in A− C, the elements 4 and 5 play no role! Neither is inA to begin with, and so we never have to throw them out.

Page 36: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

36 shahed sharif

2.4.1 The universe

To define the even numbers, one could say

{n ∈ Z | n is even}

but frequently one just writes

{n | n is even}.

Similarly, in calculus, variables almost always represent real numbers,but this is rarely explicitly stated. More generally, the set where mostof our basic objects come from in any given context is called the uni-verse; in calculus, the universe would be R, and in the even numbersexample, the universe would be Z. If the universe is understood,then it is often omitted from the set-builder notation, as in the evennumbers example above. Thus, if our universe is the set U, then weinterpret

{x | P(x)}

to mean Here, P(x) is the open statement Papplied to x.{x ∈ U | P(x)}.

If there is any doubt about what the universe is, then the secondform should be used. Note that if A is a set with universe U, thenautomatically A ⊂ U.

Definition 2.4.4. Let A be a set with universe U. Then the complementof A is U − A. It is written Ac, which is read “A complement”.

If E is the set of even integers, then we usually take U = Z, fromwhich Ec is the set of odd integers. What if A = {0}? What is Ac? Inthis case, it’s not at all obvious what the universe is. If the universe isZ, then A is the set of nonzero integers. But what if the universe is R,or C?

Now suppose that

U = {Judgments you can make about your neighbor’s clothes}.

Let A ⊂ U consist of the set of insults. Then the complement of A isthe set of compliments!15 15I suppose there are also neutral

comments, but this just ruins the joke.Proposition 2.4.5. Let A be a set with universe U. Then

(a) A ∩ Ac = ∅.

(b) A ∪ Ac = U.

(c) (Ac)c = A.

(d) ∅c = U.

Page 37: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

on writing proofs 37

(e) Uc = ∅.

The proof is left as an exercise.

Problems for Section 2.4

1. Let A = Z, B = {n ∈ Z | n is even}, C = {0}, and D = {x ∈ R |x < 0}. For all of the following, make sure to prove your answer.

(a) What is A− B?

(b) What is B− A?

(c) What is A− (B− C)?

(d) What is A− D?

(e) What is (A ∩ B)− (C ∪ D)?

2. Determine which of the following statements is true.

(a) ∀X ⊂N, ∃Y ⊂ X such that #(X−Y) = 1.

(b) ∀X ⊂N, ∃Y ⊂N such that #(Y− X) = 1.

(c) ∀X ⊂N, ∃Y ⊂ Z such that #(Y− X) = 1.

3. Let A and B be sets. Prove that A− B = A ∩ Bc.

4. Show by example that A− (B− C) 6= (A− B)− C.

5. Prove that A− B = A− (A ∩ B).

6. Prove that A− B = (A ∪ B)− B.

7. Show by example that A− B 6= (A ∪ B)− (A ∩ B).

8. Prove that (A ∪ B)− (A ∩ B) = (A− B) ∪ (B− A).16 16The expressions on both sidesof the equation are often called thesymmetric difference of A and B, writtenA4B.

9. Prove that (A ∩ B) ∪ (A ∩ Bc) = A.

10. Prove Proposition 2.4.5.

11. The following are the set-theoretic analogues of DeMorgan’s Laws.

(a) Prove that (A ∪ B)c = Ac ∩ Bc.

(b) Prove that (A ∩ B)c = Ac ∪ Bc.

12. Show the following by example.

(a) (A ∪ B)c 6= Ac ∪ Bc As you have probably guessed, 6= isslightly different than =: = meansequality always holds, while 6= meansthat sometimes inequality holds. In otherwords, ∃A, B such that the two sides areunequal.

(b) (A ∩ B)c 6= Ac ∩ Bc

Page 38: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

38 shahed sharif

2.5 Power set

Definition 2.5.1. Let S be a set. The power set of S, written P(S), is Some texts use the notation 2S for thepower set. There is a more generalnotation BA, which means the set offunctions from A to B.

the set of all subsets of S.

If S = ∅, then P(S) = {∅}. Note that S 6= P(S)—while S isthe empty set, P(S) is the set containing the empty set. To see thedifference, observe that #S = 0 but #P(S) = 1.

If S 6= ∅, then P(S) always contains the two elements ∅ and Sitself. Here are some simple examples:

• If S = {a}, then P(S) = {∅, {a}}.

• If S = {a, b}, then P(S) = {∅, {a}, {b}, {a, b}}. Note that a /∈P(S) and {a} 6⊂P(S); rather, {a} ∈P(S).

• If S = {a, b, c}, then P(S) is

{∅, {a}, {b}, {a, b},{c}, {a, c}, {b, c}, {a, b, c}}.

It can be useful to relate the subsets to each other graphically. Takethe example of S = {a, b, c}.

The astute reader will notice that thediagram looks like a perspective draw-ing of a cube. This is not a coincidence!Compare, for example, opposite faces ofthe cube. What do you observe?

{a, b, c}

uuuuuuuuu

IIIIIIIII

{a, b}

IIIIIIIII{a, c}

uuuuuuuuu

IIIIIIIII{b, c}

uuuuuuuuu

{a}

JJJJJJJJJJ {b} {c}

tttttttttt

In the diagram, if two sets are connected by a line, then the lower setis a subset of the upper set.

Proposition 2.5.2. Suppose S is a finite set. Then #P(S) = 2#S.

Proof. Suppose #S = n, and S = {x1, x2, . . . , xn}. Given a subsetX ⊂ S, we ask n questions about it: is x1 in X, is x2 in X, . . . , is xn inX? Notice that the answers to these questions uniquely determinesX.17 As each question has exactly two possible answers, there are 17“Uniquely determines” means that

knowing the answers to these questionsis identical to knowing X itself. Notethat if all the answers are “no”, thenX = ∅.

2 · 2 · · · · · 2 = 2n possible sequences of answers to all n questions.Therefore, there are exactly 2n possible subsets X.

Page 39: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

on writing proofs 39

Problems for Section 2.5

1. Suppose A = {1, 2}, B = {b, c}, and C = {(1, c), (2, b)}. Write thefollowing sets in list form.

(a) P(A)

(b) P(C)

(c) P((A× B)− C)

(d) P(P(∅)).

2. True or false: if A ⊂ B, then P(A) ⊂P(B).18 18You should of course prove youranswer. If false, it’s enough to come upwith a single example.3. Prove that A = B if and only if P(A) = P(B).

4. Let S = [0, 6]× [0, 2]. A powerful eccentric alien orders every adulton the planet to choose an element of P(S). If any two peoplechoose the same element, the planet will be vaporized. Otherwise,we each get a bag of cherries. What element would you choose?Is there some easy instruction that you could give humanity toguarantee survival?

2.6 Indexed sets

Suppose we have a bunch of different sets we want to study. If thereare three, we could name them A, B, and C (for example). Whatif there are 10? One could conceivably call them A, B, C, . . . , upuntil the 10th letter of the alphabet, which off the top of my headis . . . well, whatever it is! But of course it’s easier to name them, forexample, A1, A2, . . . , A10. The subscripts are often called indices, or inthe singular an index. In this case, the indices are n ∈ N, 1 ≤ n ≤ 10,or more simply n = 1, 2, . . . , 10.

But this is mathematics! Why stop at 10? Let’s take the followingexample. A real-valued function f (x) is said to be bounded if thereexists some real number L such that | f (x)| never exceeds L. Any con-stant function is bounded, as are sin x, cos x, and e−x2

. The functionf (x) = x is not bounded, as limx→∞ f = ∞.

Given M ∈N, let

FM = { f (x) | f is a real-valued function and | f (x)| ≤ M for every x}.

For example, 3 sin x ∈ F3, but 3 sin x /∈ F2. Put another way, F2

consists of functions whose graphs lie entirely between the linesy = 2 and y = −2. Let B = the set of all bounded functions. In otherwords,

B = { f (x) | f is a real-valued function and ∃L ∈ R such that | f (x)| ≤ L ∀x}.

Page 40: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

40 shahed sharif

Claim. With B and FM as above, B =⋃

M∈N

FM. The union notation is the same asF1 ∪ F2 ∪ · · · .

Notice that we’re taking the union of infinitely many sets! Thedefinition is the same as for two sets: f ∈ ⋃ FM means f is in one ofthe FMs, and vice versa.

The idea of the proof is that in order for a function to be bounded,it is in fact bounded by some integer M. But this means that thefunction is in FM for that particular value of M. Note that we need all of the FM, since

N sin x /∈ FM whenever N > M.Proof. We need to show that

⋃M∈N FM ⊂ B and that B ⊂ ⋃

M∈N FM.For the first containment, suppose f (x) ∈ ⋃

FM. By definition ofunion, this means that f (x) is in one of the FM, say FM0 . By defini- Notice that in order to write this proof,

you need to know lots of definitions,and know them precisely!

tion of FM0 , this means that | f (x)| ≤ M0 for all x. By definition ofbounded, we see that f (x) is bounded. Therefore f (x) ∈ B, and so⋃

FM ⊂ B.Now suppose f (x) ∈ B. This means that f (x) is bounded. By

definition of bounded, there exists some L ∈ R such that | f (x)| ≤ L Look, more definitions!

for all x. Let M0 be any integer larger than L—for example, M0 =

bL + 1c.19 Then we see see that | f (x)| ≤ M0 as well. Therefore 19The function bxc is the greatestinteger function, which means essentiallywrite the number as a decimal and thendrop everything after the decimal point.

f (x) ∈ FM0 by definition of FM0 , and we obtain f (x) ∈ ⋃M∈N FM bydefinition of union. We conclude that B ⊂ ⋃M∈N FM.

Since⋃

M∈N FM ⊂ B and B ⊂ ⋃M∈N FM, we see that B =⋃

FM.

So what just happened? We found a way to write the set ofbounded functions as a union of a bunch of other sets—in fact, ofinfinitely many sets. We refer to each of these sets with a positiveinteger. In other words, our indices are exactly the elements of N.The way this is usually phrased is, N is the index set for the FM.

In general, the indices don’t even have to be integers.

Example 2.6.1. Let C = {people in this class}. For c ∈ C, let Lc be theset of letters in c’s full name. Then

⋂c∈C

Lc is the set of letters which

every person’s name contains. This set is probably empty—well, that’smy wild guess. In this case, the index set is C.

For clarity, let us rigorously define the intersection and union of anarbitrary collection20 of sets. 20As opposed to just two.

Definition 2.6.2. Let Λ be an index set, and for each λ ∈ Λ let Aλ be aset. Then ⋃

λ∈Λ

is the set consisting of all x such that x is contained in at least one ofthe Aλ. Also, ⋂

λ∈Λ

is the set consisting of all x such that x is contained in every Aλ.

Page 41: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

on writing proofs 41

Here is an example. Let Λ = R, and define Aλ to be the set {λ}.So A0 = {0}, Aπ = {π}, and so forth. Then⋃

λ∈R

Aλ = R

and ⋃λ∈Q

Aλ = Q.

Problems for Section 2.6

1. For i ∈N, let Ai = {−i,−i + 1, . . . , i− 1, i}.

(a) Write Ai in set-builder notation.

(b) What is A1 ∪ A2 ∪ A3?

(c) What is A1 ∪ A2 ∪ · · · ∪ An?

(d) What is⋃

i∈N

Ai?

(e) What is⋂

i∈N

Ai?

2. Let In = ( 1n , 1]. (This is interval notation.) What is

⋃n∈N

In? You do

not need to prove your answer.

3. For n ∈ N, let An be the interval (− 1n , 1

n ). What are ∪An and∩An?21 You do not need to prove your answer. 21The omission of the index means

over all possible n. This is analogousto writing, for example, ∑ an instead of

∑n=1

an.

4. Let Ay ⊂ R2 where y ∈ R be given by Ay = {(x, x + y) : x ∈ R}.You do not need to prove your answers.

(a) Graph A1 ∪ A2 ∪ A3.

(b) Graph⋃

y∈Z

Ay.

(c) Graph⋃

y∈N

Ay.

(d) Graph⋃

y∈R

Ay.

(e) Graph⋃

y≥0Ay.

5. Let Bx ⊂ R2 where x ∈ R be given by Bx = {(x, x + y) : y ∈ R}.You do not need to prove your answers.

(a) Graph B1 ∪ B2 ∪ B3.

(b) Graph⋃

x∈Z

Bx.

(c) Graph⋃

x∈N

Bx.

Page 42: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

42 shahed sharif

(d) Graph⋃

x∈R

Bx.

(e) Graph⋃

x≥0Bx.

6. For n ∈ Z, let An ⊂ Z be the set of multiples of n. What are ∪An

and ∩An?

7. Let Aα = {(x, y) : |y| ≤ x2/α} where α ∈ R and α > 0. Graph ∩Aα

and ∪Aα.

8. Come up with a collection of sets Ai with i ∈ Z such that all of thefollowing hold:

• ∩Ai = {0, 1}

• ∪Ai = R

• ∀i, Ai 6= {0, 1} and Ai 6= R

9. Come up with a collection of sets Ai with i ∈ Z such that all of thefollowing hold:

• ∩Ai = Z

• ∪Ai = R

• ∀i, Ai 6= Z and Ai 6= R

10. Suppose Ai ⊂ ∩Aj for every i. What can you conclude?

11. Suppose ∪Aj ⊂ Ai for every i. What can you conclude?

12. Let A be a set. This problem does not properly speak-ing feature indexed sets, but it doesrefer to a union and intersection of acollection of sets.

(a) Compute⋃

X∈P(A)

X.

(b) Compute⋂

X∈P(A)

X.

13. For n ∈ N, let Cn = {X ∈ P(A) | #X = n}. Determine if∪Cn = P(A).

14. For (r, n) ∈ Q×N, let A(r,n) be the interval (r− 1n , r + 1

n ). Computethe following. You do not need to prove your answers.

(a)⋂

r∈Q

⋃n∈N

A(r,n)

(b)⋃

r∈Q

⋂n∈N

A(r,n)

(c)⋃

n∈N

⋂r∈Q

A(r,n)

(d)⋂

n∈N

⋃r∈Q

A(r,n)

Page 43: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

Interlude

Coming up with proofs. In this course we concentrate on the actualwriting of a proof. But obviously, you have to know what to writedown first! Suppose you are given a statement P which you are askedto prove. In order to come up with a proof, you need to

• understand P, and

• figure out the key idea or ideas which make P true.

There are two fundamental tools to solve these problems:

• Do out some specific examples. After writing down specific examples,you’ll need to be observant and imag-inative in order to deduce patterns.Writing down definitions then helps tocodify those patterns in mathematicallanguage.

• Write down the rigorous definitions of everything in P.

Ask any mathematician, and they will tell you that they do these twothings constantly! That means you should too!

Writing rigorously. In mathematics, we use the term rigor to meanthe practice of not skipping any steps, of covering every part anddetail in an argument. To become a rigorous writer takes practice,both as a writer and as a reader of mathematics. But rigor is mostimportant at the end of the problem-solving process. One way ofthinking of this is that when you solve a problem, you should proveit three times:22 22Thanks to G. Harel for this idea.

• once for yourself,

• once for your friend,

• lastly for your enemy.

The first time, you just want to get the idea of the proof with as littleself-doubt as possible. The second time, imagine you are explainingthe idea to a supportive friend. But finally, you must write down theproof so carefully that even your avowed nemesis is (reluctantly!)convinced.

Page 44: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

44 shahed sharif

What you can assume. One difficulty in introductory-level theoreti-cal math classes is figuring out what you can assume, and what youmust prove. For this class, you can assume the following:

• Any clearly stated results (propositions, theorems, etc.) in the textbefore the problem you are currently solving.

• Any exercises which were assigned for homework (except the oneyou’re doing, of course!).

• The laws of arithmetic (commutative, associative, distributive) forZ, Q, R, C, and polynomials.

• The laws governing manipulation of inequalities.

• Euclidean geometry.

That’s pretty much it!23 23Occasionally you are permitted touse other mathematical material you’velearned in other courses. Ask me ifyou’re not sure.

Page 45: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

12 Functions

Functions are both fundamental to mathematics and notoriouslyslippery concepts. Intuitively, a function is a machine that takesvalues from one set as inputs, and gives values from another set asoutputs. This characterization is way too vague to do much with;that’s why we define functions as special relations.

On the other hand, we don’t think of functions as relations; wethink of them as machines that take input values to output values! Inpractice, functions are defined this way. Here are some examples:

• f : R −→ R, f (x) is given by taking x and multiplying it by itself.(I.e. f (x) = x2.)

• g : N −→ N, g(n) is the largest perfect square which is a factor ofn.

• h : N −→ N, h(n) is obtained by by writing out n in English,taking the first letter, and outputting the number of that letter,where A = 1, B = 2, . . . , Z = 26. For example, h(1) = 15 since “O”is the 15th letter of the alphabet.

The plus side is these kinds of definitions are easier to work with.The minus is that our “definition” of a function might not actually bea function. Here are some examples:

• f : R −→ R, f (x) = 1x .

• g : N −→N, g(n) =√

n.

• h : Q −→ Z, h(x) is obtained by first writing x as a fraction ab , and

then setting h(x) = b.

In each of these cases, we say that the “function” is not well-defined.That means that we tried to define a function in a less rigorous, butconvenient way, and failed to do so because of some carelessness.There are essentially three ways a function1 can fail to, um, be a 1Really I should put function in

quotes—“function”—because not beingwell-defined means that it isn’t a function!But it’s annoying to put the quotationmarks all the time, so mathematiciansdon’t do this.

function:

1. Input problems: given f : X −→ Y, there is some x ∈ X for whichf (x) doesn’t make sense.

Page 46: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

46 shahed sharif

2. Output problems: there is some x ∈ X for which f (x) is not evenin the codomain.

3. Choice problems: there is some x ∈ X for which there are multiplepossibilities for f (x).

The last is the most subtle, and occurs with the example of h above.Just ask yourself, what is h(1)? After all, 1 = 1

1 , so h(1) should equal1. But 1 = 2

2 too, so h(1) = 2. So which is it? The answer is that his not well-defined, and should be buried in a ditch somewhere andforgotten.

The last kind of problem occurs whenever you have to makea choice in computing f (x). If the particular choice matters, as inh(x) above, then the function is not well-defined. But if the choicedoesn’t matter, the function is well-defined. Here’s an example:define j : {O, E} −→ R as follows. For j(O), pick any odd numbern and set j(O) = (−1)n. For j(E), pick any even number n and setj(E) = (−1)n. In both cases, we have infinitely many choices of n, butthe choice turns out not to matter.2 2Why not?

Problems for Section 12

1. Each of the following is not well-defined. Explain why not.

(a) f : R −→ R given by f (x) =x− 1x2 − 1

(b) g : Q×Q −→ Q given by g(

ab

,cd

)=

a + cb + d

(c) h : R −→ N given as follows: for x ∈ R, write x as a decimaland define h(x) to be the first digit after the decimal point

(d) c : {a, b, c, . . . , z} −→ {countries on Earth} given by c of a letteris the first country in alphabetical order whose name starts withthat letter

(e) F : R −→ R given by f (x) = y where y is the biggest numbersuch that y < x

(f) G :Z

4Z−→ Z given by G([n]) = n.

2. Determine whether each description below gives a well-definedfunction or not. Prove your answer by checking that the descrip-tion passes the three criteria3 to be a function. 3Some of these criteria will be obvi-

ously true, in which case you can sayso.(a) f : N −→ R given by f (n) =

√n

(b) g : R −→ C given by g(x) =√

x

(c) h : Q×Q −→ Q given by h(

ab

,cd

)=

ad + bcbd

Page 47: On Writing Proofsgiven birth, and asks her husband, “Is it a boy or a girl?” to which he responds, “Yes.” Claim. Both Annalee and Bijou are doctors. Proof. If Annalee is a

on writing proofs 47

(d) F : Q− {1/3} −→ Q given by F(a/b) =3a + b3a− b

(e) G :Z

4Z−→ Z

2Zgiven by G([n]) = [n]

(f) H :Z

3Z−→ Z

2Zgiven by H([n]) = [n]

3. Consider the last two parts of the previous problem, on G and H.A question should occur to you. Formulate and answer it.