21
p=“All humans are mortal.” q=“Hypatia is a human.” Does it follow that “Hypatia is mortal?” In propositional logic these would be two unrelated propositions We need a language to encode sets and variables (e.g., the set of humans and the element “Hypatia”) Lecture 3

Lecture3

Embed Size (px)

Citation preview

Page 1: Lecture3

• p=“All humans are mortal.”

• q=“Hypatia is a human.”

• Does it follow that “Hypatia is mortal?”

• In propositional logic these would be two unrelated propositions

• We need a language to encode sets and variables (e.g., the set of humans and the element “Hypatia”)

Lecture 3

Page 2: Lecture3

• Predicate P(x,y,z) is a statement involving a variable, e.g., x+y<z

• Universal quantifier

• For all x (in the domain), P(x)

• Existential quantifier

• There is an element x (in the domain) such that P(x)

Predicate Logic (First order Logic)

�xP (x)

�xP (x)

�x � DP (x)

�x � DP (x)

Page 3: Lecture3

Example• Let “x - y = z” be denoted by Q(x, y, z).

Find these truth values:

• Q(2,-1,3)

• Solution: T

• Q(3,4,7)

• Solution: F

• Q(x, 3, z)

• Solution: Not a Proposition

Page 4: Lecture3

Set Notation

Z = {. . . ,�2,�1, 0, 1, 2, . . . } set of integersN = {x � Z : x � 0} set of natural numbers

Z+ = {x � Z : x > 0} set of positive integersQ = {p/q : p � Z, q � Z� {0}}set of rational numbersR = the set of real numbers

Page 5: Lecture3

Examples

�x � Z(x > 0)

�x � Z+(x > 0)

�x � Z+(x < 0)�x � Z (x is even)

Page 6: Lecture3

Examples

�x � Z(x > 0) is false

�x � Z+(x > 0) is true

�x � Z+(x < 0) is false�x � Z (x is even) is true

Page 7: Lecture3

• “All humans are mortal.”

• “Hypatia is a human.”

Propositional Logic is not Enough

�xHuman(x)�Mortal(x)Human(Hypatia)=� Mortal(Hypatia)

Page 8: Lecture3

Uniqueness Quantifier

• means that P(x) is true for one and only one x in the universe of discourse.

• “There is a unique x such that P(x).”

• “There is one and only one x such that P(x)”

�!x � U(P (x))

Page 9: Lecture3

Uniqueness Quantifier

• Examples:

• The uniqueness quantifier is not really needed as the restriction that there is a unique x such that P(x) can be expressed as:

�!x � Z(x + 1 = 0) is true�!x � Z(x > 0) is false

�x(P (x) � �y(P (y) � (y = x)))

Page 10: Lecture3

Are These Negations Correct?

• Every animal wags its tail when it is happy

• No animal wags its tail when it is happy.

• There is an animal that wags its tail when happy

• There is an animal that does not wag its tail when happy

Page 11: Lecture3

Correct Negations

• Every animal wags its tail when it is happy

• There is an animal that does not wag its tail when it is happy

• There is an animal that wags its tail when happy

• All animals do not wag their tail when happy

Page 12: Lecture3

Negation of Quantified Expressions

¬(�x � SP (x)) �� �x � S¬P (x)

¬(�x � SP (x)) �� �x � S¬P (x)

Page 13: Lecture3
Page 14: Lecture3

Nested Quantifiers

�y � R�x � R : x + y = 0• There is a y such that for all x, x+y=0

• Is this true?

Page 15: Lecture3

• There is a y such that for all x, x+y=0

• False!

• The correct proposition is the following:

�y � R�x � R : x + y = 0

�y � R�x � R : x + y = 0

Page 16: Lecture3

The Order of Quantifiers is Important

• The converse might not be true!

�y�xP (x, y) is true =� �x�yP (x, y) is true

�x�yP (x, y) is true =� �y�xP (x, y) is true

Page 17: Lecture3

Are These True?

�x > 0�y > 0�

x

y= 1

�x > 0�y > 0�

x

y= 1

Page 18: Lecture3

The Negation is True (so original is false)

¬��x > 0�y > 0

�x

y= 1

����

�x > 0�y > 0�

x

y�= 1

e.g., x = 3, y = 4

Page 19: Lecture3

The Negation is True (so the original is false)

¬��x > 0�y > 0

�x

y= 1

����

�x > 0�y > 0�

x

y�= 1

e.g., y = 2x

Page 20: Lecture3

Example: Limit of a Function

• Can be considered as a game (or challenge)

• You give me any

• I guarantee you that I can find an interval

• Such that for all values of x in that interval, the distance from f(x) to L is smaller than

limx�a

f(x) = L :��

�� > 0�� > 0�x(0 < |x� a| < � � |f(x)� L| < �

� > 0

0 < |x� a| < �

Page 21: Lecture3

Negating Limit Definition

limx�a

f(x) �= L ��

¬(�� > 0�� > 0�x(0 < |x� a| < � � |f(x)� L| < �)) ���� > 0�� > 0�x¬(0 < |x� a| < � � |f(x)� L| < �) ���� > 0�� > 0�x(0 < |x� a| < � � |f(x)� L| � �)

The last step uses the equivalence ¬(p→q) ≡ p∧¬q