Lecture 1: Course Intro + Propositional Logic Or: How I Learned to - - PowerPoint PPT Presentation

lecture 1 course intro propositional logic
SMART_READER_LITE
LIVE PREVIEW

Lecture 1: Course Intro + Propositional Logic Or: How I Learned to - - PowerPoint PPT Presentation

Lecture 1: Course Intro + Propositional Logic Or: How I Learned to Stop Worrying and Love the Class 1 / 23 Welcome to CS 70! What is this course? CS 70 is a math course. Focus on proofs and justifjcations Practice mathematical


slide-1
SLIDE 1

Lecture 1: Course Intro + Propositional Logic

Or: How I Learned to Stop Worrying and Love the Class

1 / 23

slide-2
SLIDE 2

Welcome to CS 70!

What is this course? CS 70 is a math course. Focus on proofs and justifjcations Practice “mathematical thinking” Also an EECS course. Probability, Cryptography, Graphs, ... Applications throughout EECS Why is this course? Learn to think critically and argue clearly See the building blocks of Computer Science Adapting to this mindset can be hard — don’t be discouraged, and do ask for help when you need it!

2 / 23

slide-3
SLIDE 3

Welcome to CS 70!

What is this course?

▶ CS 70 is a math course.

▶ Focus on proofs and justifjcations ▶ Practice “mathematical thinking”

Also an EECS course. Probability, Cryptography, Graphs, ... Applications throughout EECS Why is this course? Learn to think critically and argue clearly See the building blocks of Computer Science Adapting to this mindset can be hard — don’t be discouraged, and do ask for help when you need it!

2 / 23

slide-4
SLIDE 4

Welcome to CS 70!

What is this course?

▶ CS 70 is a math course.

▶ Focus on proofs and justifjcations ▶ Practice “mathematical thinking”

▶ Also an EECS course.

▶ Probability, Cryptography, Graphs, ... ▶ Applications throughout EECS

Why is this course? Learn to think critically and argue clearly See the building blocks of Computer Science Adapting to this mindset can be hard — don’t be discouraged, and do ask for help when you need it!

2 / 23

slide-5
SLIDE 5

Welcome to CS 70!

What is this course?

▶ CS 70 is a math course.

▶ Focus on proofs and justifjcations ▶ Practice “mathematical thinking”

▶ Also an EECS course.

▶ Probability, Cryptography, Graphs, ... ▶ Applications throughout EECS

Why is this course? Learn to think critically and argue clearly See the building blocks of Computer Science Adapting to this mindset can be hard — don’t be discouraged, and do ask for help when you need it!

2 / 23

slide-6
SLIDE 6

Welcome to CS 70!

What is this course?

▶ CS 70 is a math course.

▶ Focus on proofs and justifjcations ▶ Practice “mathematical thinking”

▶ Also an EECS course.

▶ Probability, Cryptography, Graphs, ... ▶ Applications throughout EECS

Why is this course?

▶ Learn to think critically and argue clearly

See the building blocks of Computer Science Adapting to this mindset can be hard — don’t be discouraged, and do ask for help when you need it!

2 / 23

slide-7
SLIDE 7

Welcome to CS 70!

What is this course?

▶ CS 70 is a math course.

▶ Focus on proofs and justifjcations ▶ Practice “mathematical thinking”

▶ Also an EECS course.

▶ Probability, Cryptography, Graphs, ... ▶ Applications throughout EECS

Why is this course?

▶ Learn to think critically and argue clearly ▶ See the building blocks of Computer Science

Adapting to this mindset can be hard — don’t be discouraged, and do ask for help when you need it!

2 / 23

slide-8
SLIDE 8

Welcome to CS 70!

What is this course?

▶ CS 70 is a math course.

▶ Focus on proofs and justifjcations ▶ Practice “mathematical thinking”

▶ Also an EECS course.

▶ Probability, Cryptography, Graphs, ... ▶ Applications throughout EECS

Why is this course?

▶ Learn to think critically and argue clearly ▶ See the building blocks of Computer Science

Adapting to this mindset can be hard — don’t be discouraged, and do ask for help when you need it!

2 / 23

slide-9
SLIDE 9

Stafg Introductions

▶ Lecturers ▶ TAs ▶ Readers / Academic Interns

3 / 23

slide-10
SLIDE 10

Logistics

Course website: eecs70.org

▶ Has homeworks, lecture notes, slides, etc.

Piazza: main avenue of communication

▶ Ask any questions here! ▶ Can make a private post or email

su19@eecs70.org for more personal questions

▶ Will also post announcements here

Homework 0 (logistics) already out, Homework 1 coming soon

4 / 23

slide-11
SLIDE 11

A Word on Homeworks

Intended to help you internalize the material. Previous grading system focused on getting all the answers, even if you weren’t learning anything. This summer, new grading policy to address this: Graded on putting “reasonable efgort” into each problem (see website for details) Translation: try all the problems, write down your thought process and where exactly you got stuck Readers still give detailed feedback Do still try your best on the homeworks — they’re there for your benefjt!

5 / 23

slide-12
SLIDE 12

A Word on Homeworks

Intended to help you internalize the material. Previous grading system focused on getting all the answers, even if you weren’t learning anything. This summer, new grading policy to address this:

▶ Graded on putting “reasonable efgort” into

each problem (see website for details)

▶ Translation: try all the problems, write down

your thought process and where exactly you got stuck

▶ Readers still give detailed feedback ▶ Do still try your best on the homeworks —

they’re there for your benefjt!

5 / 23

slide-13
SLIDE 13

Lewis Carroll and Logic

(I) No one, who is going to a party, ever fails to brush his or her hair. (II) No one looks fascinating, if he or she is untidy. (III) Opium-eaters have no self-command. (IV) Everyone who has brushed his or her hair looks fascinating. (V) No one wears kid gloves, unless he or she is going to a party. (VI) A person is always untidy if he or she has no self-command.

  • Lewis Carroll, Symbolic Logic, 1896

Alice brushed her hair. What else do we know?

6 / 23

slide-14
SLIDE 14

Lewis Carroll and Logic

(I) No one, who is going to a party, ever fails to brush his or her hair. (II) No one looks fascinating, if he or she is untidy. (III) Opium-eaters have no self-command. (IV) Everyone who has brushed his or her hair looks fascinating. (V) No one wears kid gloves, unless he or she is going to a party. (VI) A person is always untidy if he or she has no self-command.

  • Lewis Carroll, Symbolic Logic, 1896

Alice brushed her hair. What else do we know?

6 / 23

slide-15
SLIDE 15

Propositions

A statement which is (unambiguously) true or false. Basic building block of our logical system. Examples: 2 2 4 (True) I had pizza for breakfast this morning (False) Even integers are the sum of two primes1 (???) Not examples: A Pop-Tart is a sandwich (defjne sandwich) x 2 7 (what is x?) 17 (not making a claim) Jazz is better than Rock (personal preference)

1This is known as the Goldbach Conjecture

7 / 23

slide-16
SLIDE 16

Propositions

A statement which is (unambiguously) true or false. Basic building block of our logical system. Examples:

▶ 2 + 2 = 4 (True) ▶ I had pizza for breakfast this morning (False) ▶ Even integers are the sum of two primes1 (???)

Not examples: A Pop-Tart is a sandwich (defjne sandwich) x 2 7 (what is x?) 17 (not making a claim) Jazz is better than Rock (personal preference)

1This is known as the Goldbach Conjecture

7 / 23

slide-17
SLIDE 17

Propositions

A statement which is (unambiguously) true or false. Basic building block of our logical system. Examples:

▶ 2 + 2 = 4 (True) ▶ I had pizza for breakfast this morning (False) ▶ Even integers are the sum of two primes1 (???)

Not examples:

▶ A Pop-Tart is a sandwich (defjne sandwich) ▶ x + 2 = 7 (what is x?) ▶ 17 (not making a claim) ▶ Jazz is better than Rock (personal preference)

1This is known as the Goldbach Conjecture

7 / 23

slide-18
SLIDE 18

Propositional Formulae

Can combine propositions with logical operators:

▶ P ∧ Q (Conjunction, “both P and Q”) ▶ P ∨ Q (Disjunction, “at least one of P or Q”) ▶ ¬P (Negation, “not P”)

String together for more complicated formulae: P Q R P Q P P Q R P Q R Use parentheses: P Q R is ambiguous!

8 / 23

slide-19
SLIDE 19

Propositional Formulae

Can combine propositions with logical operators:

▶ P ∧ Q (Conjunction, “both P and Q”) ▶ P ∨ Q (Disjunction, “at least one of P or Q”) ▶ ¬P (Negation, “not P”)

String together for more complicated formulae:

▶ P ∧ Q ∧ R ▶ (P ∨ Q) ∧ (¬P) ▶ (P ∧ Q ∧ R) ∨ ((¬P) ∧ (¬Q) ∧ (¬R))

Use parentheses: P Q R is ambiguous!

8 / 23

slide-20
SLIDE 20

Propositional Formulae

Can combine propositions with logical operators:

▶ P ∧ Q (Conjunction, “both P and Q”) ▶ P ∨ Q (Disjunction, “at least one of P or Q”) ▶ ¬P (Negation, “not P”)

String together for more complicated formulae:

▶ P ∧ Q ∧ R ▶ (P ∨ Q) ∧ (¬P) ▶ (P ∧ Q ∧ R) ∨ ((¬P) ∧ (¬Q) ∧ (¬R))

Use parentheses: P ∧ Q ∨ R is ambiguous!

8 / 23

slide-21
SLIDE 21

Truth Tables

Would like to be able to compare formulae. Ex: P ∨ Q vs ¬((¬P) ∧ (¬Q)) Idea: treat formulae as functions. Inputs are T/F values to each proposition Output is T/F value of overall formula Equivalent if have same truth table For our example: P Q P Q P Q P Q F F T T F F F T T F T T T F F T T T T T F F T T

9 / 23

slide-22
SLIDE 22

Truth Tables

Would like to be able to compare formulae. Ex: P ∨ Q vs ¬((¬P) ∧ (¬Q)) Idea: treat formulae as functions.

▶ Inputs are T/F values to each proposition ▶ Output is T/F value of overall formula ▶ Equivalent if have same truth table

For our example: P Q P Q P Q P Q F F T T F F F T T F T T T F F T T T T T F F T T

9 / 23

slide-23
SLIDE 23

Truth Tables

Would like to be able to compare formulae. Ex: P ∨ Q vs ¬((¬P) ∧ (¬Q)) Idea: treat formulae as functions.

▶ Inputs are T/F values to each proposition ▶ Output is T/F value of overall formula ▶ Equivalent if have same truth table

For our example: P Q ¬P ¬Q ¬((¬P) ∧ (¬Q)) P ∨ Q F F T T F F F T T F T T T F F T T T T T F F T T

9 / 23

slide-24
SLIDE 24

Our First Theorem

Claim: Can express any truth table as a formula.2 Example (on two variables): P Q F F T F T F T F T T T F P Q P Q General Form: Disjunction (or) of many “and” clauses One clause for each satisfying assignment

2This means our language is fully expressive.

10 / 23

slide-25
SLIDE 25

Our First Theorem

Claim: Can express any truth table as a formula.2 Example (on two variables): P Q ϕ F F T F T F T F T T T F P Q P Q General Form: Disjunction (or) of many “and” clauses One clause for each satisfying assignment

2This means our language is fully expressive.

10 / 23

slide-26
SLIDE 26

Our First Theorem

Claim: Can express any truth table as a formula.2 Example (on two variables): P Q ϕ F F T F T F T F T T T F ϕ = P Q P Q General Form: Disjunction (or) of many “and” clauses One clause for each satisfying assignment

2This means our language is fully expressive.

10 / 23

slide-27
SLIDE 27

Our First Theorem

Claim: Can express any truth table as a formula.2 Example (on two variables): P Q ϕ F F T F T F T F T T T F ϕ = P Q P Q General Form: Disjunction (or) of many “and” clauses One clause for each satisfying assignment

2This means our language is fully expressive.

10 / 23

slide-28
SLIDE 28

Our First Theorem

Claim: Can express any truth table as a formula.2 Example (on two variables): P Q ϕ F F T F T F T F T T T F ϕ = P Q P Q General Form: Disjunction (or) of many “and” clauses One clause for each satisfying assignment ϕ not satisfjed! Fix this.

2This means our language is fully expressive.

10 / 23

slide-29
SLIDE 29

Our First Theorem

Claim: Can express any truth table as a formula.2 Example (on two variables): P Q ϕ F F T F T F T F T T T F ϕ = ((¬P) ∧ (¬Q)) P Q General Form: Disjunction (or) of many “and” clauses One clause for each satisfying assignment ϕ not satisfjed! Fix this.

2This means our language is fully expressive.

10 / 23

slide-30
SLIDE 30

Our First Theorem

Claim: Can express any truth table as a formula.2 Example (on two variables): P Q ϕ F F T F T F T F T T T F ϕ = ((¬P) ∧ (¬Q)) P Q General Form: Disjunction (or) of many “and” clauses One clause for each satisfying assignment

2This means our language is fully expressive.

10 / 23

slide-31
SLIDE 31

Our First Theorem

Claim: Can express any truth table as a formula.2 Example (on two variables): P Q ϕ F F T F T F T F T T T F ϕ = ((¬P) ∧ (¬Q)) P Q General Form: Disjunction (or) of many “and” clauses One clause for each satisfying assignment ϕ not satisfjed, which is good.

2This means our language is fully expressive.

10 / 23

slide-32
SLIDE 32

Our First Theorem

Claim: Can express any truth table as a formula.2 Example (on two variables): P Q ϕ F F T F T F T F T T T F ϕ = ((¬P) ∧ (¬Q)) P Q General Form: Disjunction (or) of many “and” clauses One clause for each satisfying assignment

2This means our language is fully expressive.

10 / 23

slide-33
SLIDE 33

Our First Theorem

Claim: Can express any truth table as a formula.2 Example (on two variables): P Q ϕ F F T F T F T F T T T F ϕ = ((¬P) ∧ (¬Q)) P Q General Form: Disjunction (or) of many “and” clauses One clause for each satisfying assignment ϕ not satisfjed! Fix this.

2This means our language is fully expressive.

10 / 23

slide-34
SLIDE 34

Our First Theorem

Claim: Can express any truth table as a formula.2 Example (on two variables): P Q ϕ F F T F T F T F T T T F ϕ = ((¬P) ∧ (¬Q))∨(P ∧ (¬Q)) General Form: Disjunction (or) of many “and” clauses One clause for each satisfying assignment ϕ not satisfjed! Fix this.

2This means our language is fully expressive.

10 / 23

slide-35
SLIDE 35

Our First Theorem

Claim: Can express any truth table as a formula.2 Example (on two variables): P Q ϕ F F T F T F T F T T T F ϕ = ((¬P) ∧ (¬Q))∨(P ∧ (¬Q)) General Form: Disjunction (or) of many “and” clauses One clause for each satisfying assignment

2This means our language is fully expressive.

10 / 23

slide-36
SLIDE 36

Our First Theorem

Claim: Can express any truth table as a formula.2 Example (on two variables): P Q ϕ F F T F T F T F T T T F ϕ = ((¬P) ∧ (¬Q))∨(P ∧ (¬Q)) General Form: Disjunction (or) of many “and” clauses One clause for each satisfying assignment ϕ not satisfjed, which is good.

2This means our language is fully expressive.

10 / 23

slide-37
SLIDE 37

Our First Theorem

Claim: Can express any truth table as a formula.2 Example (on two variables): P Q ϕ F F T F T F T F T T T F ϕ = ((¬P) ∧ (¬Q))∨(P ∧ (¬Q)) General Form:

▶ Disjunction (or) of many “and” clauses ▶ One clause for each satisfying assignment

2This means our language is fully expressive.

10 / 23

slide-38
SLIDE 38

De Morgan’s Laws

How does negation interact with ∧ and ∨? P Q “It is not the case that both P and Q are true” P Q “Either P or Q must be false” Saying the same thing! P Q P Q Try the same thing with ! P Q “It cannot be that either P or Q is true” P Q “Both P and Q are false” Again the same! P Q P Q

11 / 23

slide-39
SLIDE 39

De Morgan’s Laws

How does negation interact with ∧ and ∨?

▶ ¬(P ∧ Q)

“It is not the case that both P and Q are true” P Q “Either P or Q must be false” Saying the same thing! P Q P Q Try the same thing with ! P Q “It cannot be that either P or Q is true” P Q “Both P and Q are false” Again the same! P Q P Q

11 / 23

slide-40
SLIDE 40

De Morgan’s Laws

How does negation interact with ∧ and ∨?

▶ ¬(P ∧ Q)

“It is not the case that both P and Q are true”

▶ (¬P) ∨ (¬Q)

“Either P or Q must be false” Saying the same thing! P Q P Q Try the same thing with ! P Q “It cannot be that either P or Q is true” P Q “Both P and Q are false” Again the same! P Q P Q

11 / 23

slide-41
SLIDE 41

De Morgan’s Laws

How does negation interact with ∧ and ∨?

▶ ¬(P ∧ Q)

“It is not the case that both P and Q are true”

▶ (¬P) ∨ (¬Q)

“Either P or Q must be false” Saying the same thing! ¬(P ∧ Q) ≡ (¬P) ∨ (¬Q) Try the same thing with ! P Q “It cannot be that either P or Q is true” P Q “Both P and Q are false” Again the same! P Q P Q

11 / 23

slide-42
SLIDE 42

De Morgan’s Laws

How does negation interact with ∧ and ∨?

▶ ¬(P ∧ Q)

“It is not the case that both P and Q are true”

▶ (¬P) ∨ (¬Q)

“Either P or Q must be false” Saying the same thing! ¬(P ∧ Q) ≡ (¬P) ∨ (¬Q) Try the same thing with ∨!

▶ ¬(P ∨ Q)

“It cannot be that either P or Q is true” P Q “Both P and Q are false” Again the same! P Q P Q

11 / 23

slide-43
SLIDE 43

De Morgan’s Laws

How does negation interact with ∧ and ∨?

▶ ¬(P ∧ Q)

“It is not the case that both P and Q are true”

▶ (¬P) ∨ (¬Q)

“Either P or Q must be false” Saying the same thing! ¬(P ∧ Q) ≡ (¬P) ∨ (¬Q) Try the same thing with ∨!

▶ ¬(P ∨ Q)

“It cannot be that either P or Q is true”

▶ (¬P) ∧ (¬Q)

“Both P and Q are false” Again the same! P Q P Q

11 / 23

slide-44
SLIDE 44

De Morgan’s Laws

How does negation interact with ∧ and ∨?

▶ ¬(P ∧ Q)

“It is not the case that both P and Q are true”

▶ (¬P) ∨ (¬Q)

“Either P or Q must be false” Saying the same thing! ¬(P ∧ Q) ≡ (¬P) ∨ (¬Q) Try the same thing with ∨!

▶ ¬(P ∨ Q)

“It cannot be that either P or Q is true”

▶ (¬P) ∧ (¬Q)

“Both P and Q are false” Again the same! ¬(P ∨ Q) ≡ (¬P) ∧ (¬Q)

11 / 23

slide-45
SLIDE 45

An Interesting Corollary

Claim: Only needs ∨ and ¬ to be fully expressive. Why? Follow this procedure:

  • 1. Start with any truth table
  • 2. Previous theorem gives formula
  • 3. Use De Morgan’s Laws to eliminate all

s End with equivalent formula using only and ! Can instead eliminate all s, leaving only and .

12 / 23

slide-46
SLIDE 46

An Interesting Corollary

Claim: Only needs ∨ and ¬ to be fully expressive. Why? Follow this procedure:

  • 1. Start with any truth table
  • 2. Previous theorem gives formula ϕ
  • 3. Use De Morgan’s Laws to eliminate all ∧s

End with equivalent formula using only ¬ and ∨! Can instead eliminate all s, leaving only and .

12 / 23

slide-47
SLIDE 47

An Interesting Corollary

Claim: Only needs ∨ and ¬ to be fully expressive. Why? Follow this procedure:

  • 1. Start with any truth table
  • 2. Previous theorem gives formula ϕ
  • 3. Use De Morgan’s Laws to eliminate all ∧s

End with equivalent formula using only ¬ and ∨! Can instead eliminate all ∨s, leaving only ∧ and ¬.

12 / 23

slide-48
SLIDE 48

Implications

Even though we have enough to be fully expressive, having more operators is much more convenient. One important symbol: implication ( = ⇒ ) P Q P = ⇒ Q (¬P) ∨ Q F F T T F T T T T F F F T T T T Read: “P implies Q” or “if P then Q” Equivalent to (¬P) ∨ Q

13 / 23

slide-49
SLIDE 49

Wait a Second!

Why is “F = ⇒ T” true? Think about “If it rains, the streets will be wet.” What if a fjre hydrant breaks? Alternative is biconditional (“if and only if”) P Q P Q F F T F T F T F F T T T P Q P Q Q P Exercise: verify this with truth tables!

14 / 23

slide-50
SLIDE 50

Wait a Second!

Why is “F = ⇒ T” true? Think about “If it rains, the streets will be wet.” What if a fjre hydrant breaks? Alternative is biconditional (“if and only if”) P Q P Q F F T F T F T F F T T T P Q P Q Q P Exercise: verify this with truth tables!

14 / 23

slide-51
SLIDE 51

Wait a Second!

Why is “F = ⇒ T” true? Think about “If it rains, the streets will be wet.” What if a fjre hydrant breaks? Alternative is biconditional (“if and only if”) P Q P Q F F T F T F T F F T T T P Q P Q Q P Exercise: verify this with truth tables!

14 / 23

slide-52
SLIDE 52

Wait a Second!

Why is “F = ⇒ T” true? Think about “If it rains, the streets will be wet.” What if a fjre hydrant breaks? Alternative is biconditional ⇐ ⇒ (“if and only if”) P Q P ⇐ ⇒ Q F F T F T F T F F T T T P Q P Q Q P Exercise: verify this with truth tables!

14 / 23

slide-53
SLIDE 53

Wait a Second!

Why is “F = ⇒ T” true? Think about “If it rains, the streets will be wet.” What if a fjre hydrant breaks? Alternative is biconditional ⇐ ⇒ (“if and only if”) P Q P ⇐ ⇒ Q F F T F T F T F F T T T (P ⇐ ⇒ Q) ≡ ((P = ⇒ Q) ∧ (Q = ⇒ P)) Exercise: verify this with truth tables!

14 / 23

slide-54
SLIDE 54

Converse and Contrapositive

How does P = ⇒ Q compare to Q = ⇒ P? P Q P Q Q P F F T T F T T F T F F T T T T T Not the same! Think “if it rains, the streets will be wet” versus “if the streets are wet, it rained”. If want logical equivalence, need contrapositive: Q P Think “if the streets are not wet, it did not rain”.

15 / 23

slide-55
SLIDE 55

Converse and Contrapositive

How does P = ⇒ Q compare to Q = ⇒ P? P Q P = ⇒ Q Q = ⇒ P F F T T F T T F T F F T T T T T Not the same! Think “if it rains, the streets will be wet” versus “if the streets are wet, it rained”. If want logical equivalence, need contrapositive: Q P Think “if the streets are not wet, it did not rain”.

15 / 23

slide-56
SLIDE 56

Converse and Contrapositive

How does P = ⇒ Q compare to Q = ⇒ P? P Q P = ⇒ Q Q = ⇒ P F F T T F T T F T F F T T T T T Not the same! Think “if it rains, the streets will be wet” versus “if the streets are wet, it rained”. If want logical equivalence, need contrapositive: (¬Q) = ⇒ (¬P) Think “if the streets are not wet, it did not rain”.

15 / 23

slide-57
SLIDE 57

A Well-Deserved Break

Listening to someone talk for an hour and a half is

  • tough. Will include a ∼4 minute break somewhere.

Good time to get to know your neighbors! Ask questions, form study groups, or just, ya know, be social :) Today’s discussion question: Does pineapple belong on pizza?

16 / 23

slide-58
SLIDE 58

A Well-Deserved Break

Listening to someone talk for an hour and a half is

  • tough. Will include a ∼4 minute break somewhere.

Good time to get to know your neighbors! Ask questions, form study groups, or just, ya know, be social :) Today’s discussion question: Does pineapple belong on pizza?

16 / 23

slide-59
SLIDE 59

A Well-Deserved Break

Listening to someone talk for an hour and a half is

  • tough. Will include a ∼4 minute break somewhere.

Good time to get to know your neighbors! Ask questions, form study groups, or just, ya know, be social :) Today’s discussion question: Does pineapple belong on pizza?

16 / 23

slide-60
SLIDE 60

Quantifjers

For any natural number x, defjne two propositions:

▶ E(x) says that “x is even” ▶ O(x) says that “x is odd”

How to say “0 is either even or odd”? Easy enough: E 0 O 0 “Everything smaller than 3 is either even or odd”? E 0 O 0 E 1 O 1 E 2 O 2 “All natural numbers are either even or odd”? O no. Requires an infjnitely-long formula :( Need new tools.

17 / 23

slide-61
SLIDE 61

Quantifjers

For any natural number x, defjne two propositions:

▶ E(x) says that “x is even” ▶ O(x) says that “x is odd”

How to say “0 is either even or odd”? Easy enough: E(0) ∨ O(0) “Everything smaller than 3 is either even or odd”? E 0 O 0 E 1 O 1 E 2 O 2 “All natural numbers are either even or odd”? O no. Requires an infjnitely-long formula :( Need new tools.

17 / 23

slide-62
SLIDE 62

Quantifjers

For any natural number x, defjne two propositions:

▶ E(x) says that “x is even” ▶ O(x) says that “x is odd”

How to say “0 is either even or odd”? Easy enough: E(0) ∨ O(0) “Everything smaller than 3 is either even or odd”? E 0 O 0 E 1 O 1 E 2 O 2 “All natural numbers are either even or odd”? O no. Requires an infjnitely-long formula :( Need new tools.

17 / 23

slide-63
SLIDE 63

Quantifjers

For any natural number x, defjne two propositions:

▶ E(x) says that “x is even” ▶ O(x) says that “x is odd”

How to say “0 is either even or odd”? Easy enough: E(0) ∨ O(0) “Everything smaller than 3 is either even or odd”? (E(0) ∨ O(0)) ∧ (E(1) ∨ O(1)) ∧ (E(2) ∨ O(2)) “All natural numbers are either even or odd”? O no. Requires an infjnitely-long formula :( Need new tools.

17 / 23

slide-64
SLIDE 64

Quantifjers

For any natural number x, defjne two propositions:

▶ E(x) says that “x is even” ▶ O(x) says that “x is odd”

How to say “0 is either even or odd”? Easy enough: E(0) ∨ O(0) “Everything smaller than 3 is either even or odd”? (E(0) ∨ O(0)) ∧ (E(1) ∨ O(1)) ∧ (E(2) ∨ O(2)) “All natural numbers are either even or odd”? O no. Requires an infjnitely-long formula :( Need new tools.

17 / 23

slide-65
SLIDE 65

Quantifjers

For any natural number x, defjne two propositions:

▶ E(x) says that “x is even” ▶ O(x) says that “x is odd”

How to say “0 is either even or odd”? Easy enough: E(0) ∨ O(0) “Everything smaller than 3 is either even or odd”? (E(0) ∨ O(0)) ∧ (E(1) ∨ O(1)) ∧ (E(2) ∨ O(2)) “All natural numbers are either even or odd”? O no. Requires an infjnitely-long formula :( Need new tools.

17 / 23

slide-66
SLIDE 66

Quantifjers

For any natural number x, defjne two propositions:

▶ E(x) says that “x is even” ▶ O(x) says that “x is odd”

How to say “0 is either even or odd”? Easy enough: E(0) ∨ O(0) “Everything smaller than 3 is either even or odd”? (E(0) ∨ O(0)) ∧ (E(1) ∨ O(1)) ∧ (E(2) ∨ O(2)) “All natural numbers are either even or odd”? O no. Requires an infjnitely-long formula :( Need new tools.

17 / 23

slide-67
SLIDE 67

Quantifjers

∀ (“for all”) and ∃ (“there exists”) Now write (∀n ∈ N)(E(n) ∨ O(n)) For a proposition P x 3 and a set S, we say x S P x if P x holds for all x S x S P x if P x holds for some x S If S clear from context or doesn’t matter4, may omit Multiple free variables needs multiple quantifjers! Example: x y x y Careful! and don’t commute with each other.

3Here, x is a variable allowed to appear in P, called a “free variable” 4or we’re just lazy

18 / 23

slide-68
SLIDE 68

Quantifjers

∀ (“for all”) and ∃ (“there exists”) Now write (∀n ∈ N)(E(n) ∨ O(n)) For a proposition P(x)3 and a set S, we say

▶ (∀x ∈ S)P(x) if P(x) holds for all x ∈ S ▶ (∃x ∈ S)P(x) if P(x) holds for some x ∈ S

If S clear from context or doesn’t matter4, may omit Multiple free variables needs multiple quantifjers! Example: x y x y Careful! and don’t commute with each other.

3Here, x is a variable allowed to appear in P, called a “free variable” 4or we’re just lazy

18 / 23

slide-69
SLIDE 69

Quantifjers

∀ (“for all”) and ∃ (“there exists”) Now write (∀n ∈ N)(E(n) ∨ O(n)) For a proposition P(x)3 and a set S, we say

▶ (∀x ∈ S)P(x) if P(x) holds for all x ∈ S ▶ (∃x ∈ S)P(x) if P(x) holds for some x ∈ S

If S clear from context or doesn’t matter4, may omit Multiple free variables needs multiple quantifjers! Example: (∀x ∈ N)(∃y ∈ N)(x = y) Careful! and don’t commute with each other.

3Here, x is a variable allowed to appear in P, called a “free variable” 4or we’re just lazy

18 / 23

slide-70
SLIDE 70

Quantifjers

∀ (“for all”) and ∃ (“there exists”) Now write (∀n ∈ N)(E(n) ∨ O(n)) For a proposition P(x)3 and a set S, we say

▶ (∀x ∈ S)P(x) if P(x) holds for all x ∈ S ▶ (∃x ∈ S)P(x) if P(x) holds for some x ∈ S

If S clear from context or doesn’t matter4, may omit Multiple free variables needs multiple quantifjers! Example: (∀x ∈ N)(∃y ∈ N)(x = y) Careful! ∀ and ∃ don’t commute with each other.

3Here, x is a variable allowed to appear in P, called a “free variable” 4or we’re just lazy

18 / 23

slide-71
SLIDE 71

Negation and Quantifers

How does negation interact with quantifjers? x P x “P x is not true for all x” x P x “There is some x such that P x doesn’t hold” Saying the same thing! x P x x P x What about with ? x P x “There is no x satisfying P x ” x P x “P x is false for all x” Again the same thing! x P x x P x

19 / 23

slide-72
SLIDE 72

Negation and Quantifers

How does negation interact with quantifjers?

▶ ¬(∀x P(x))

“P(x) is not true for all x” x P x “There is some x such that P x doesn’t hold” Saying the same thing! x P x x P x What about with ? x P x “There is no x satisfying P x ” x P x “P x is false for all x” Again the same thing! x P x x P x

19 / 23

slide-73
SLIDE 73

Negation and Quantifers

How does negation interact with quantifjers?

▶ ¬(∀x P(x))

“P(x) is not true for all x”

▶ ∃x (¬P(x))

“There is some x such that P(x) doesn’t hold” Saying the same thing! x P x x P x What about with ? x P x “There is no x satisfying P x ” x P x “P x is false for all x” Again the same thing! x P x x P x

19 / 23

slide-74
SLIDE 74

Negation and Quantifers

How does negation interact with quantifjers?

▶ ¬(∀x P(x))

“P(x) is not true for all x”

▶ ∃x (¬P(x))

“There is some x such that P(x) doesn’t hold” Saying the same thing! ¬(∀x P(x)) ≡ ∃x (¬P(x)) What about with ? x P x “There is no x satisfying P x ” x P x “P x is false for all x” Again the same thing! x P x x P x

19 / 23

slide-75
SLIDE 75

Negation and Quantifers

How does negation interact with quantifjers?

▶ ¬(∀x P(x))

“P(x) is not true for all x”

▶ ∃x (¬P(x))

“There is some x such that P(x) doesn’t hold” Saying the same thing! ¬(∀x P(x)) ≡ ∃x (¬P(x)) What about with ∃?

▶ ¬(∃x P(x))

“There is no x satisfying P(x)” x P x “P x is false for all x” Again the same thing! x P x x P x

19 / 23

slide-76
SLIDE 76

Negation and Quantifers

How does negation interact with quantifjers?

▶ ¬(∀x P(x))

“P(x) is not true for all x”

▶ ∃x (¬P(x))

“There is some x such that P(x) doesn’t hold” Saying the same thing! ¬(∀x P(x)) ≡ ∃x (¬P(x)) What about with ∃?

▶ ¬(∃x P(x))

“There is no x satisfying P(x)”

▶ ∀x (¬P(x))

“P(x) is false for all x” Again the same thing! x P x x P x

19 / 23

slide-77
SLIDE 77

Negation and Quantifers

How does negation interact with quantifjers?

▶ ¬(∀x P(x))

“P(x) is not true for all x”

▶ ∃x (¬P(x))

“There is some x such that P(x) doesn’t hold” Saying the same thing! ¬(∀x P(x)) ≡ ∃x (¬P(x)) What about with ∃?

▶ ¬(∃x P(x))

“There is no x satisfying P(x)”

▶ ∀x (¬P(x))

“P(x) is false for all x” Again the same thing! ¬(∃x P(x)) ≡ ∀x (¬P(x))

19 / 23

slide-78
SLIDE 78

An Alternate Intuition

Recall De Morgan’s Laws from earlier:

▶ ¬(P ∧ Q) ≡ (¬P) ∨ (¬Q) ▶ ¬(P ∨ Q) ≡ (¬P) ∧ (¬Q)

is like a conjunction ( ) x P x is like P 0 P 1 P 2 is like a disjunction ( ) x P x is like P 0 P 1 P 2 interacts with and like with and !

20 / 23

slide-79
SLIDE 79

An Alternate Intuition

Recall De Morgan’s Laws from earlier:

▶ ¬(P ∧ Q) ≡ (¬P) ∨ (¬Q) ▶ ¬(P ∨ Q) ≡ (¬P) ∧ (¬Q)

∀ is like a conjunction (∧) (∀x ∈ N)P(x) is like P(0) ∧ P(1) ∧ P(2) ∧ ... ∃ is like a disjunction (∨) (∃x ∈ N)P(x) is like P(0) ∨ P(1) ∨ P(2) ∨ ... ¬ interacts with ∀ and ∃ like with ∧ and ∨!

20 / 23

slide-80
SLIDE 80

Lewis Carroll 2: Electric Boogaloo

Recall: (I) No one, who is going to a party, ever fails to brush his or her hair. (II) No one looks fascinating, if he or she is untidy. (III) Opium-eaters have no self-command. (IV) Everyone who has brushed his or her hair looks fascinating. (V) No one wears kid gloves, unless he or she is going to a party. (VI) A person is always untidy if he or she has no self-command. Translate this to propositional logic!

21 / 23

slide-81
SLIDE 81

Lewis Carroll 2: Electric Boogaloo

Recall: (I) No one, who is going to a party, ever fails to brush his or her hair. (II) No one looks fascinating, if he or she is untidy. (III) Opium-eaters have no self-command. (IV) Everyone who has brushed his or her hair looks fascinating. (V) No one wears kid gloves, unless he or she is going to a party. (VI) A person is always untidy if he or she has no self-command. Translate this to propositional logic!

21 / 23

slide-82
SLIDE 82

Lewis Carroll 2: Electric Boogaloo

Recall: (I) P(x) = ⇒ B(x) (II) No one looks fascinating, if he or she is untidy. (III) Opium-eaters have no self-command. (IV) Everyone who has brushed his or her hair looks fascinating. (V) No one wears kid gloves, unless he or she is going to a party. (VI) A person is always untidy if he or she has no self-command. Translate this to propositional logic!

21 / 23

slide-83
SLIDE 83

Lewis Carroll 2: Electric Boogaloo

Recall: (I) P(x) = ⇒ B(x) (II) U(x) = ⇒ (¬F(x)) (III) Opium-eaters have no self-command. (IV) Everyone who has brushed his or her hair looks fascinating. (V) No one wears kid gloves, unless he or she is going to a party. (VI) A person is always untidy if he or she has no self-command. Translate this to propositional logic!

21 / 23

slide-84
SLIDE 84

Lewis Carroll 2: Electric Boogaloo

Recall: (I) P(x) = ⇒ B(x) (II) U(x) = ⇒ (¬F(x)) (III) O(x) = ⇒ (¬S(x)) (IV) Everyone who has brushed his or her hair looks fascinating. (V) No one wears kid gloves, unless he or she is going to a party. (VI) A person is always untidy if he or she has no self-command. Translate this to propositional logic!

21 / 23

slide-85
SLIDE 85

Lewis Carroll 2: Electric Boogaloo

Recall: (I) P(x) = ⇒ B(x) (II) U(x) = ⇒ (¬F(x)) (III) O(x) = ⇒ (¬S(x)) (IV) B(x) = ⇒ F(x) (V) No one wears kid gloves, unless he or she is going to a party. (VI) A person is always untidy if he or she has no self-command. Translate this to propositional logic!

21 / 23

slide-86
SLIDE 86

Lewis Carroll 2: Electric Boogaloo

Recall: (I) P(x) = ⇒ B(x) (II) U(x) = ⇒ (¬F(x)) (III) O(x) = ⇒ (¬S(x)) (IV) B(x) = ⇒ F(x) (V) K(x) = ⇒ P(x) (VI) A person is always untidy if he or she has no self-command. Translate this to propositional logic!

21 / 23

slide-87
SLIDE 87

Lewis Carroll 2: Electric Boogaloo

Recall: (I) P(x) = ⇒ B(x) (II) U(x) = ⇒ (¬F(x)) (III) O(x) = ⇒ (¬S(x)) (IV) B(x) = ⇒ F(x) (V) K(x) = ⇒ P(x) (VI) (¬S(x)) = ⇒ U(x) Translate this to propositional logic!

21 / 23

slide-88
SLIDE 88

(Lewis Carroll 2: Electric Boogaloo) 2

(I) P(x) = ⇒ B(x) (III) O(x) = ⇒ (¬S(x)) (V) K(x) = ⇒ P(x) (II) U(x) = ⇒ (¬F(x)) (IV) B(x) = ⇒ F(x) (VI) (¬S(x)) = ⇒ U(x) Alice brushed her hair. What else do we know? B x

IV

F x

II c

U x

VI c

S x

III c

O x So Alice looks fascinating, is not untidy, has self control, and is not an opium-eater. Is she going to a party? Not enough information!

22 / 23

slide-89
SLIDE 89

(Lewis Carroll 2: Electric Boogaloo) 2

(I) P(x) = ⇒ B(x) (III) O(x) = ⇒ (¬S(x)) (V) K(x) = ⇒ P(x) (II) U(x) = ⇒ (¬F(x)) (IV) B(x) = ⇒ F(x) (VI) (¬S(x)) = ⇒ U(x) Alice brushed her hair. What else do we know? B(x)

IV

F x

II c

U x

VI c

S x

III c

O x So Alice looks fascinating, is not untidy, has self control, and is not an opium-eater. Is she going to a party? Not enough information!

22 / 23

slide-90
SLIDE 90

(Lewis Carroll 2: Electric Boogaloo) 2

(I) P(x) = ⇒ B(x) (III) O(x) = ⇒ (¬S(x)) (V) K(x) = ⇒ P(x) (II) U(x) = ⇒ (¬F(x)) (IV) B(x) = ⇒ F(x) (VI) (¬S(x)) = ⇒ U(x) Alice brushed her hair. What else do we know? B(x)

IV

= ⇒ F(x)

II c

U x

VI c

S x

III c

O x So Alice looks fascinating, is not untidy, has self control, and is not an opium-eater. Is she going to a party? Not enough information!

22 / 23

slide-91
SLIDE 91

(Lewis Carroll 2: Electric Boogaloo) 2

(I) P(x) = ⇒ B(x) (III) O(x) = ⇒ (¬S(x)) (V) K(x) = ⇒ P(x) (II) U(x) = ⇒ (¬F(x)) (IV) B(x) = ⇒ F(x) (VI) (¬S(x)) = ⇒ U(x) Alice brushed her hair. What else do we know? B(x)

IV

= ⇒ F(x)

II(c)

= ⇒ ¬U(x)

VI c

S x

III c

O x So Alice looks fascinating, is not untidy, has self control, and is not an opium-eater. Is she going to a party? Not enough information!

22 / 23

slide-92
SLIDE 92

(Lewis Carroll 2: Electric Boogaloo) 2

(I) P(x) = ⇒ B(x) (III) O(x) = ⇒ (¬S(x)) (V) K(x) = ⇒ P(x) (II) U(x) = ⇒ (¬F(x)) (IV) B(x) = ⇒ F(x) (VI) (¬S(x)) = ⇒ U(x) Alice brushed her hair. What else do we know? B(x)

IV

= ⇒ F(x)

II(c)

= ⇒ ¬U(x)

VI(c)

= ⇒ S(x)

III c

O x So Alice looks fascinating, is not untidy, has self control, and is not an opium-eater. Is she going to a party? Not enough information!

22 / 23

slide-93
SLIDE 93

(Lewis Carroll 2: Electric Boogaloo) 2

(I) P(x) = ⇒ B(x) (III) O(x) = ⇒ (¬S(x)) (V) K(x) = ⇒ P(x) (II) U(x) = ⇒ (¬F(x)) (IV) B(x) = ⇒ F(x) (VI) (¬S(x)) = ⇒ U(x) Alice brushed her hair. What else do we know? B(x)

IV

= ⇒ F(x)

II(c)

= ⇒ ¬U(x)

VI(c)

= ⇒ S(x)

III(c)

= ⇒ ¬O(x) So Alice looks fascinating, is not untidy, has self control, and is not an opium-eater. Is she going to a party? Not enough information!

22 / 23

slide-94
SLIDE 94

(Lewis Carroll 2: Electric Boogaloo) 2

(I) P(x) = ⇒ B(x) (III) O(x) = ⇒ (¬S(x)) (V) K(x) = ⇒ P(x) (II) U(x) = ⇒ (¬F(x)) (IV) B(x) = ⇒ F(x) (VI) (¬S(x)) = ⇒ U(x) Alice brushed her hair. What else do we know? B(x)

IV

= ⇒ F(x)

II(c)

= ⇒ ¬U(x)

VI(c)

= ⇒ S(x)

III(c)

= ⇒ ¬O(x) So Alice looks fascinating, is not untidy, has self control, and is not an opium-eater. Is she going to a party? Not enough information!

22 / 23

slide-95
SLIDE 95

(Lewis Carroll 2: Electric Boogaloo) 2

(I) P(x) = ⇒ B(x) (III) O(x) = ⇒ (¬S(x)) (V) K(x) = ⇒ P(x) (II) U(x) = ⇒ (¬F(x)) (IV) B(x) = ⇒ F(x) (VI) (¬S(x)) = ⇒ U(x) Alice brushed her hair. What else do we know? B(x)

IV

= ⇒ F(x)

II(c)

= ⇒ ¬U(x)

VI(c)

= ⇒ S(x)

III(c)

= ⇒ ¬O(x) So Alice looks fascinating, is not untidy, has self control, and is not an opium-eater. Is she going to a party? Not enough information!

22 / 23

slide-96
SLIDE 96

(Lewis Carroll 2: Electric Boogaloo) 2

(I) P(x) = ⇒ B(x) (III) O(x) = ⇒ (¬S(x)) (V) K(x) = ⇒ P(x) (II) U(x) = ⇒ (¬F(x)) (IV) B(x) = ⇒ F(x) (VI) (¬S(x)) = ⇒ U(x) Alice brushed her hair. What else do we know? B(x)

IV

= ⇒ F(x)

II(c)

= ⇒ ¬U(x)

VI(c)

= ⇒ S(x)

III(c)

= ⇒ ¬O(x) So Alice looks fascinating, is not untidy, has self control, and is not an opium-eater. Is she going to a party? Not enough information!

22 / 23

slide-97
SLIDE 97

Fin

Next time: proofs!

23 / 23