60
Chapter 2: The Logic of Quantified Statements January 14, 2008

Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Chapter 2: The Logic of QuantifiedStatements

January 14, 2008

Page 2: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Outline

1 2.1 Introduction to Predicates and Quantified Statements I

2 2.2 Introduction to Predicates and Quantified Statements II

3 2.3 Statements Containing Multiple Quantifiers

Page 3: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Consider the following argument

All students in Electrical Engineering have to take MTH314.Tarik is a student in Electrical Engineering.

∴ Tarik has to take MTH314.

This seems to be a valid argument from the point of view oflogic. However, we cannot show that using the methods ofChapter 1, since the first statement cannot be translated usingonly the symbols ∼, ∧, ∨, →, or ↔.

Page 4: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Basic Facts and Notation For Sets

• A set is some collection of objects, which we call elementsof the set. For example,

A = { blue , red , yellow }

andB = {0, 2, 5, 13,−4}

are examples of sets.• To write the fact that an object x is an element of a set A,

we writex ∈ A

whilex 6∈ A

will denote the fact that x is not an element of A.

Page 5: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

• We will use the following notation for familiar sets ofnumbers:

1 R for the set of all real numbers2 Z for the set of all integers3 Q for the set of all rational numbers (quotients of integers)

• By putting + or - in the superscript, we indicate the set ofpositive or negative numbers; e.g

R+

will stand for all positive real numbers, etc.• Instead of writing Z+, the set of all positive integers is often

called the set of natural numbers and the notation for it isN.

Page 6: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Predicates

• We have seen in Chapter 1, that a sentence

x2 + x > 2

is not a statement since its truth (or falsity) depends onwhat value we assign to the variable x .

• Similarly, the sentence

She is a student at Ryerson.

is not a statement either, since we have to know who “she”refers to in order to determine the truth value.

• Such sentences are called predicates. They are notstatements unless we interpret the variables in them asparticular elements of some prescribed set. After that, theybecome true or false statements.

Page 7: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

DefinitionA predicate is a sentence that contains a finite number ofvariables and becomes a statement once these variables areassigned some specific values. The domain of a predicatevariable is the set of all values that can be substituted for thevariable.

• For example, for the predicate P(x)

x2 + x > 2

the domain can be any set of numbers (R, Z, . . . ) in whichits operations (+,·,. . . ) make sense.

• A predicate could involve any number of variables; e.g.Q(x , y) is the sentence

x is divisible by y3

Page 8: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

ExampleConsider the predicate P(x)

x2 + x > 2

with the domain R. For what x ∈ R is this predicate true?

• For x = 2,P(2) : 22 + 2 > 2, true

• For x = −13 ,

P(−13) : (−1

3)2 + (−1

3) > 1, false

• It can be shown, using some basic facts about quadraticequations that P(x) is true provided

x < −2 or x > 1

Page 9: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

DefinitionIf P(x) is a predicate whose truth domain is D, the truth set ofP(x) is the set of all elements of D which make P(x) true whenthey are substituted for x . We write the truth set for P(x) as

{x ∈ D|P(x)}

which we read as “the set of all x in D such that P(x) is true”.

Page 10: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

ExampleConsider the predicate Q(n) stating

n divides 5

(a) If the truth domain is Z, the truth set of this predicate is

{−5,−1, 1, 5}

(b) If the truth domain is the set of all positive integers Z+,then the truth set will be

{1, 5}

• We see, based on this example, that for the samepredicate, the truth set may change when we change thetruth domain (the set of possible values of the variable)

Page 11: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Universal Quantifier

• One of the ways in which we can turn a predicate P(x) intoa statement is, for example, to state the following

For all x , P(x).

• We write that as∀x , P(x)

• The symbol ∀ means “for all” (“for any”, “for each”) and iscalled the universal quantifier.

• For example, the sentenceAll students in Electrical Engineering must take MTH314.

can be written as∀x ∈ E , P(x)

where E is the set of all students in Electrical Engineering,and P(x) is the predicate “x must take MTH314”.

Page 12: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

DefinitionSuppose Q(x) is a predicate and D is the truth domain for x . Auniversal statement is a statement of the form

∀x ∈ D, Q(x).

It is true if, and only if, Q(x) is true for every x in D. If there isan x in D for which Q(x) is false, this universal statement willbe false.The value of x for which Q(x) is false is called acounterexample for the universal statement.

Page 13: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

ExampleLet D = {−5, 8, 9, 11} and consider the statement

∀x ∈ D, x2 + x > 2

Show that this statement is true.Solution: We check that

x2 + x > 2

is true for all x ∈ D. (This is called the method of exhaustion)

(−5)2 + (−5) > 2

82 + 8 > 2

92 + 9 > 2

112 + 11 > 2

∀x ∈ D, x2 + x > 2

is true

Page 14: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

ExampleNow, show that

∀x ∈ R, x2 + x > 2

is false.Solution: It suffices to find one value of x ∈ R for which it is notthe case that

x2 + x > 2

In other words, we are looking for a counterexample in R.One such counterexample is, e.g. x = −1 since

(−1)2 + (−1) 6> 2

Therefore,∀x ∈ R, x2 + x > 2

is false.

Page 15: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Existential Quantifier

• Another way to turn a predicate Q(x) into a sentence is toassert that

“There exists x such that Q(x).”• The notation for this is

∃x , Q(x)

• ∃ is the existential quantifier and its meaning is “thereexists”, “there is a”, “for some”, “there is at least one”, etc.

Page 16: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

DefinitionLet Q(x) be a predicate and D the truth domain of x . Anexistential statement is a statement of the form

∃x ∈ D such that Q(x)

It is true if, and only if, Q(x) is true for at least one element x ofD. It will be false if, Q(x) is false for all x ∈ D.

Page 17: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

ExampleShow that the statement

∃n ∈ Z such that n2 = n

is true.Solution: It suffices to find an integer n such that

n2 = n

Obviously, one such integer is

n = 1.

Page 18: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

ExampleGiven the truth domain

A = {2,−7, 3, 5}

show that the existential statement

∃n ∈ A such that n2 = n

is false.Solution: Clearly,

22 6= 2

(−7)2 6= −7

32 6= 3

52 6= 5

Since there is no element n ∈ A for which n2 = n, thisexistential statement is false.

Page 19: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

• Given a statement involving quantifiers, it is generallypossible to translate it into English using in a variety ofways:

Example

∀x ∈ R, x2 ≥ 0.

This can be translated as:• Every real number has a non-negative square.• x has a non-negative square, for any real number x .• No real number can have a non-negative square, etc.

Page 20: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

ExamplesTranslate the following statements into formal logic statements,using quantifiers and variables:(a) The sum of angles of every rectangle is 360◦.(b) Some integers are divisible by 6.(c) No real number has -4 as its square.

Solution:(a) ∀x ∈ R, sum of angles of x is 360◦.

(R-set of all rectangles)(b) ∃n ∈ Z such that n is divisible by 6.(c) ∀x ∈ R, x2 6= −4.

Page 21: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Universal Conditional Statements• One of the most common types of universal statements

encountered in mathematics is the universal conditionalstatement

∀x , if P(x) then Q(x).

ExampleConsider the statement

∀x ∈ R, if x ≥ 3 then x2 ≥ 9.

which can be translated as

If a real number is at least 3, then its square is at least 9.

or

The square of any real number, which is at least 3, is at least 9.

Page 22: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

ExamplesRewrite each of the following statements as a universalconditional statement:(a) If an integer is divisible by 4, then it is divisible by 2.(b) No bird is a mammal.

Solution:(a) ∀n ∈ Z, if n is divisible by 4, then n is divisible by 2.

(b) ∀x , if x is a bird, then x is not a mammal.

Page 23: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Equivalent Forms of QuantifiedStatements

• Consider the statement∀x , if x ∈ Z, then x ∈ Q.

(Every integer is a rational number)• This statement can be rewritten as

∀x ∈ Z, x ∈ Q• What we did here was to restrict the truth domain to

integers.• Conversely, if D is the truth domain for the predicate P(x),

the statement∀x ∈ D, P(x)

can be rewritten as∀x , if x ∈ D, then P(x)

Page 24: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

ExampleRewrite the statement

The square of any even integer is even.

as a universal logical statement in two different ways.Solution:• ∀n, if n is even, then n2 is even.• ∀ even n, n2 is even.

Page 25: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

ExampleA prime number is an integer greater than 1 whose onlypositive factors are 1 and the integer itself.Let Prime(n) stand for the predicate “n is prime”, and letEven(n) denote the predicate “n is even”.Consider the statement

There is an integer that is prime and even.

Rewrite this statement as an existential statement using thepredicates Prime(n) and Even(n).Solution:• ∃n such that Prime(n) ∧ Even(n).• ∃ an even integer n such that Prime(n).• ∃ a prime integer n such that Even(n).

Page 26: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Implicit Quantification

• It is quite common in mathematics that statements whichseemingly are not quantified contain quantifiers implicitly

Example

1 If x ≥ 3 then x2 ≥ 9.

∀x ∈ R, x ≥ 3 → x2 ≥ 9

2 12 is a product of an even and an odd integer.

∃ odd m and even n, such that 12 = m · n

Page 27: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

• The statement

∀x ∈ R, x ≥ 3 → x2 ≥ 9

can also be written in the following way (which is quitecommon in mathematics):

x ≥ 3 =⇒ x2 ≥ 9

DefinitionIf P(x) and Q(x) are predicates which have the same domainD, the notation

P(x) =⇒ Q(x)

means that every element x ∈ D which is in the truth set forP(x) is also in the truth set of Q(x). Equivalently,

∀x , P(x) → Q(x)

Page 28: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

The notationP(x) ⇐⇒ Q(x)

means that the universal statement

∀x , P(x) ↔ Q(x)

is true; i.e. that P(x) and Q(x) have the same truth sets.

Page 29: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

ExampleSuppose Q(n), R(n), and S(n) are the following predicates

Q(n): “n is a factor of 8.”R(n): “n is a factor of 4.”S(n): “n < 5 and n 6= 3.”

whose domain is Z+. use =⇒ and ⇐⇒ to find the relationshipbetween predicates Q(n), R(n) and S(n).

Page 30: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Solution: The truth sets in Z+ for these three statements are

Q(n) :{1, 2, 4, 8}R(n) :{1, 2, 4}S(n) :{1, 2, 4}

We see that:

R(n) ⇐⇒ S(n)

R(n) =⇒ Q(n)

S(n) =⇒ Q(n)

Page 31: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Negations of Quantified Statements

• Consider the following statement:“All engineering students have to take MTH 314.”

• If we want to negate this statement, intuitively, we wouldphrase it in the following way:“There are some engineering students which do not have

to take MTH 314.”• Note that we cannot negate the original statement by

saying:“No engineering students have to take MTH 314.”

Page 32: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Theorem(Negation of a Universal Statement) The negation of astatement

∀x in D, P(x)

is logically equivalent to a statement of the form

∃x in D such that ∼ P(x)

We can write that as

∼ (∀x ∈ D, P(x)) ≡ ∃x ∈ D such that ∼ P(x)

Page 33: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

• If we were to negate the existential statement

“Some birds are mammals.”

the correct logical reasoning would indicate that it shouldsay:

“No birds are mammals.”

instead of

“Some birds are not mammals.”

Page 34: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Theorem(Negation of an Existential Statement) The negation of astatement

∃x in D such that P(x)

is logically equivalent to a statement of the form

∀x in D, ∼ P(x)

We can write that as

∼ (∃x ∈ D such that P(x)) ≡ ∀x ∈ D, ∼ P(x)

Page 35: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

ExamplesWrite the formal negations of the following statements:(a) ∀ prime n, n is odd.

(b) ∃ a continuous function f on [a, b] such that∫ b

a f (x)dx doesnot exist.

(c) No integers are divisible by 6.

Solution:(a) ∃ a prime n such that n is not odd.

(b) ∀ continuous function f on [a, b],∫ b

a f (x)dx exists.(c) This statement is equivalent to: “∀ integer n, n is not

divisible by 6.”So, its negation is equivalent to: “∃ an integer n such that nis divisible by 6.”

Page 36: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Negations of Universal ConditionalStatements

• Suppose we want to negate a universal conditionalstatement

∀x , P(x) → Q(x)

• Then, based on what we have just seen about negations ofuniversal statements, we see that

∼ (∀x , P(x) → Q(x)) ≡ ∃x such that ∼ (P(x) → Q(x))

• However,

∼ (P(x) → Q(x)) ≡ P(x)∧ ∼ Q(x)

• So,

∼ (∀x , P(x) → Q(x)) ≡ ∃x such that (P(x)∧ ∼ Q(x)).

Page 37: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

• We have just proved the equivalence

∼ (∀x , P(x) → Q(x)) ≡ ∃x such that (P(x)∧ ∼ Q(x))

ExamplesWrite formal negations for the following statements:(a) ∀ integer n, if n is even, then n is divisible by 4.(b) If a computer program P compiles without any error

messages, then P is correct.

Solution:(a) ∃ an integer n such that n is even and n is not divisible by 4.(b) ∃ a computer program P such that P compiles without any

error messages and P is not correct.

Page 38: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Relation Among ∀, ∃, ∧, and ∨

• Suppose we are looking at quantified statements whichrefer to a finite domain

D = {x1, x2, . . . , xn}

• Saying that the statement

∀x ∈ D, P(x)

is true, is equivalent to saying that P(x) is true for everyxi ∈ D:

P(x1) ∧ P(x2) ∧ . . . ∧ P(xn)

Page 39: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

ExampleSuppose

D = {1,−1}

and P(x) is the predicate x2 = 1. Then

∀x ∈ D, P(x)

is true sinceP(1) ∧ P(−1)

is true.

Page 40: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

• On the other hand,

∃x ∈ D such that P(x)

is equivalent to the statement

P(x1) ∨ P(x2) ∨ . . . ∨ P(xn)

ExampleIn the same domain D = {1,−1} consider the predicate Q(x)stating that x2 = x . In that case,

∃x ∈ D such that Q(x)

is true sinceQ(1) ∨Q(−1)

Page 41: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

• Remark: If we have a universal statement

∀x ∈ D, if P(x) then Q(x)

then this statement is vacuously true if, and only if, P(x) isfalse for every x ∈ D.

ExampleFor instance, the statement

∀x ∈ R, if x 6= x then x > 0

is vacuously true, because the hypothesis of the predicate

x 6= x

is false for every x ∈ R.

Page 42: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Variants of Universal ConditionalStatements

DefinitionConsider a universal conditional statement

∀x ∈ D, if P(x) then Q(x)

1 Its contrapositive is the statement

∀x ∈ D, if ∼ Q(x) then ∼ P(x)

2 Its converse is

∀x ∈ D, if Q(x) then P(x)

3 Its inverse is

∀x ∈ D, if ∼ P(x) then ∼ Q(x)

Page 43: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

ExampleGiven the statement

∀x ∈ R, if x > 2, then 3x + 2 > 8

write its contrapositive, converse and inverse statements.Solution:• Contrapositive:

∀x ∈ R, if 3x + 2 6> 8, then x 6> 2

• Converse:

∀x ∈ R, if 3x + 2 > 8, then x > 2

• Inverse:

∀x ∈ R, if x 6> 2, then 3x + 2 6> 8.

Page 44: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

• The usual equivalences (and non-equivalences) are alsotrue for universal conditional statements; namely:

conditional statement ≡ its contrapositiveconditional statement 6≡ its converseconditional statement 6≡ its inverse

converse ≡ inverse

Page 45: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Necessary and Sufficient Conditions;Only If

Definition

1. “∀x , P(x) is a sufficient condition for Q(x)” means

∀x , if P(x) then Q(x)

2. “∀x , P(x) is a necessary condition for Q(x)” means

∀x , if ∼ P(x) then ∼ Q(x)

or, equivalently,

∀x , if Q(x) then P(x)

Page 46: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Definition(Only If) “∀x , P(x) only if Q(x)” means

∀x , if ∼ Q(x) then ∼ P(x)

or, equivalently,∀x , if P(x) then Q(x)

Page 47: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

ExamplesRewrite each of the following statements as a universalconditional statement:(a) Squareness is a sufficient condition for rectangularity.(b) Being at least 18 years old is a necessary condition for

eligibility to vote in national elections.(c) A product of two integers is odd only if both of them are

odd.

Solution:(a) ∀x , if x is a square, then x is a rectangle.(b) ∀ people x , if x is eligible to vote in national elections, then

x is at least 18 years old.(c)

∀m, n ∈ Z, if mn is odd , then m, n are both odd

Page 48: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Statements Containing MultipleQuantifiers

Consider the following two statements about real numbers:

(a)∀x ∈ R,∃y ∈ R, such that x < y

(b)∃y ∈ R, such that ∀x ∈ R, x < y

These two statements say the following:• For every real number x , there is a larger real number y

(True.)• There exists a real number y such that it is larger than any

real number x . (False.)

Page 49: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Conclusion: We see that by reversing the order of quantifiers ina statement which involves two or more quantifiers, thestatement may change considerably.

Question:Given a statement of the form

∀x ∈ D,∃y ∈ E such that P(x , y)

or∃x ∈ D such that ∀y ∈ E , P(x , y)

how do we verify whether such a statement is true or false?

Page 50: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Suppose we want to check the truth value of the statement

∀x ∈ D,∃y ∈ E such that P(x , y)

We can think of it as a game we play with another player (TheSpoiler) which works in the following way:

1 The Spoiler picks an arbitrary element x in D.2 You respond by trying to find an element y in E for which

P(x , y) is true.3 If you have no answer for The Spoiler’s move, the

statement is false; if you can match any choice of x in TheSpoiler’s move with a good choice of y , you win and thestatement is true.

Page 51: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

ExampleIn the All Here Tilomino world, we want to check the truth valueof the statement:

For every circle x , there is a triangle y which is east of x .

Solution:• If The Spoiler picks the unnamed circle, we pick either the

unnamed triangle in the same row or b.• If The Spoiler picks g, we pick the triangle b.• For The Spoiler’s choice of d , we can respond by choosing

b.Since we have a winning strategy for the game, the statementis true.

Page 52: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Suppose we want to check the truth value of the statement

∃x ∈ D, such that ∀y ∈ E , P(x , y)

We can think of it as a game we play with another player (TheSpoiler) which works in the following way:

1 We pick one fixed element x of D, which we are notallowed to change until the end of the game.

2 The Spoiler tries to challenge our choice of x by listing allpossible choices of y from E and hoping that, for at leastone of them, he/she will show that P(x , y) fails. (In themeantime, we twiddle our thumbs and hope for the best...)

3 If the spoiler doesn’t succeed in challenging our choice ofx , we have won the game and the statement is true; if theymanage to find a y in E which will disprove P(x , y), welose the game and the statement is false.

Page 53: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

ExampleAgain, in the All here Tilomino world, we want to check the truthvalue of the statement

There is a circle x such that, for all squares y , x is north of y .

Solution:• Suppose we choose the circle in row 2 of the grid.• The Spoiler lists e; it does not disprove the statement.• The Spoiler then tries f ; still, our choice of the circle works.• Finally, The Spoiler is left with the last square, a; our

choice is still a good one.The Spoiler’s attempts to challenge our choice of x failed. So,we have won the game and the statement is true in thisTilomino world.

Page 54: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

ExampleThe reciprocal of a real number a is a real number b such thatab = 1.The following two statements are true. Rewrite them usingquantifiers and variables.(a) Every nonzero real number has a reciprocal.(b) There is a real number with no reciprocal.

Solution:(a) ∀ nonzero real number x , ∃ a real number y such that

xy = 1(b) ∃ a real number z such that ∀ real numbers u, zu 6= 1.

Page 55: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Examples

(a) The statement

∃x ∈ Z+ such that ∀y ∈ Z+, x ≤ y

is true since it expresses the fact that there is the smallestpositive integer (which is 1).

(b) Now, if we change the domains of x and y to R+, positivereal numbers, we have

∃x ∈ R+ such that ∀y ∈ R+, x ≤ y

which is false, since, no matter how small x is, there is asmaller positive real number (e.g. x/2)

Page 56: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Negations of Statements with MultipleQuantifiers

• Suppose we want to negate the statement

∀x ∈ D,∃y ∈ E such that P(x , y)

• Then, using what we have already learned about negatingquantified statements, we have

∼ (∀x ∈ D,∃y ∈ E such that P(x , y))

≡ ∃x ∈ D such that ∼ (∃y ∈ E such that P(x , y))

≡ ∃x ∈ D such that ∀y ∈ E , ∼ P(x , y)

Page 57: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

• Similarly, we can show that the statement

∼ (∃x ∈ D such that ∀y ∈ E , P(x , y))

is equivalent to the statement

∀x ∈ D,∃y ∈ E such that ∼ P(x , y)

Page 58: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

ExampleIn the All Here Tilomino world, write a negation for each of thefollowing statements and determine their truth values of thesenegations:(a) For all circles x , there is a square y such that x and y have

the same size.(b) There is a square x such that, for every triangle y , x is

west of y .

Solution:(a) There is a circle x such that, for every square y , x and y

are not of the same size. (This statement is false)(b) For every square x , there exists a triangle y , so that x is

not west of y . (This statement is true)

Page 59: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Order of Quantifiers• As we have seen earlier, the order of quantifiers matters.

E.g., the following two statements are not equivalent:

∀x ∈ R∃y ∈ R such that x ≤ y

and∃y ∈ R such that ∀x ∈ R, x ≤ y

• However, if the quantifiers are identical, then the order isirrelevant. For example,

∀x ∈ R and ∀y ∈ R, x · y = y · x

is logically equivalent to

∀y ∈ R and ∀x ∈ R, x · y = y · x .

• This equivalence is also true in the case when there aretwo existential quantifiers.

Page 60: Chapter 2: The Logic of Quantified Statementsmth314/W08/Slides/Chapter2.pdf · statements unless we interpret the variables in them as particular elements of some prescribed set

Remarks: The following is also true1 “∀x ∈ D, P(x)” can be written as

∀x(x ∈ D → P(x))

2 “∃x ∈ D such that P(x)” can be written as

∃x(x ∈ D ∧ P(x))