The document discusses propositional functions and quantifiers in predicate logic. It defines propositional functions as functions that take arguments and evaluate to true or false, expressing a predicate. Quantifiers like the universal quantifier ∀ and existential quantifier ∃ are used to make predicates into propositions by specifying whether the predicate is true for all or some values in the universe of discourse. Examples demonstrate writing English statements in logical notation using propositional functions and quantifiers.
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
PredicatesQuantifiers.docx
1. 1/ 33
Introduction
Propositional Functions
Slides by Christopher M. Bourke
Propositional
Functions Instructor: Berthe Y. Choueiry
Quantifiers
Logic
Programming
Transcribing
English into
Logic Fall 2007
Predicate Logic and Quantifiers
2. 2/ 33
Further Computer Science & Engineering 235
Examples &
Exercises Introduction to Discrete Mathematics
Sections 1.3–1.4 of Rosen cse235@cse.unl.edu
Introduction
Predicate
Logic and
Quantifiers
CSE235
Consider the following statements:
x > 3, x = y + 3, x + y = z
4. 4/ 33
Terminology:
affirmed =
holds = is true;
denied = does not hold = is not true.
|{z} | {z }
Propositional
subject predicate
Functions
Predicate
Logic and
Quantifiers
CSE235
Introduction
To write in predicate logic:
“ x is greater than 3”
Propositional
Functions
Quantifiers
Logic
Programming
Transcribing
English into
We introduce a (functional) symbol for the predicate, and put
the subject as an argument (to the functional symbol): P(x)
Examples:
6. Examples &
Exercises
6/ 33
Propositional Functions
Predicate
Logic and
Quantifiers Definition
CSE235
A statement of the form P(x1,x2,...,xn) is the value of the Introduction
propositional function P. Here, (x1,x2,...,xn) is an n-tuple Propositional and
P is a predicate.
Functions
Propositional
Universe of
Discourse
Quantifiers
You can think of a propositional function as a function that
7. Examples &
Exercises
7/ 33
Propositional Functions
Functions
Evaluates to true or false.
Logic Programming
Takes one or more arguments.
Transcribing
intoExpresses a predicate involving the argument(s).
English
Logic
Becomes a proposition when values are assigned to the
Further
arguments.
8. Examples &
Exercises
8/ 33
Propositional Functions
Example
Predicate
Logic and
Quantifiers Example
CSE235
Let Q(x,y,z) denote the statement “x2 + y2 = z2”. What is
Introduction the truth value of Q(3,4,5)? What is the truth value of
Propositional
Functions Q(2,2,3)? How many values of (x,y,z) make the predicate
Propositional true?
9. Examples &
Exercises
9/ 33
Propositional Functions
Functions
Universe of
Discourse
Quantifiers
Logic
Programming
Transcribing
English into Logic
Further
Example
Predicate
Logic and
11. Examples &
Exercises
11/ 33
Propositional Functions
CSE235
Let Q(x,y,z) denote the statement “x2 + y2 = z2”. What is
Introduction the truth value of Q(3,4,5)? What is the truth value of
Propositional
Quantifiers
Logic
Programming
Transcribing
English into Logic
Further
Since 32 + 42 = 25 = 52, Q(3,4,5) is true.
Since 22 + 22 = 8 6= 32 = 9, Q(2,2,3) is false.
There are infinitely many values for (x,y,z) that make this
propositional function true—how many right triangles are
there?
14. Examples &
Exercises
6/ 33
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Consider the previous example. Does it make sense to assign to
x the value “blue”?
Intuitively, the universe of discourse is the set of all things we
16. Transcribing
English into Logic
Further8/ 33
Examples &
Transcribing
English into
Logic
What would be the universe of discourse for the propositional
function P(x) = “The test will be on x the 23rd” be?
17. Examples &
Exercises
9/ 33
Universe of Discourse
Universe of wish to talk about; that is, the set of all objects that we can
Discourse
Further
18. Transcribing
English into Logic
Further10/ 33
Examples &
Universe of Discourse
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Moreover, each variable in an n-tuple may have a different
universe of discourse.
Let P(r,g,b,c) = “The rgb-value of the color c is (r,g,b)”.
20. Transcribing
English into Logic
Further12/ 33
Examples &
Multivariate Functions
Universe of
Discourse
Transcribing
English into
Logic
What are the universes of discourse for (r,g,b,c)?
22. Transcribing
English into Logic
Further14/ 33
Examples &
Quantifiers
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
A predicate becomes a proposition when we assign it fixed
values. However, another way to make a predicate into a
proposition is to quantify it. That is, the predicate is true (or
false) for all possible values in the universe of discourse or for
26. Transcribing
English into Logic
Further18/ 33
Examples &
Universal Quantifier
Example I
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Definition
P (x)
P (x) x
∀xP (x)
which can be read “for all x
28. Transcribing
English into Logic
Further20/ 33
Examples &
Universal Quantifier
Example I
Propositional Functions
Quantifiers
Universal
Quantifier
∀xP(x) ⇐⇒ P(n1) ∧ P(n2) ∧ ··· ∧ P(nk)
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
If the universe of discourse is finite, say {n1,n2,...,nk}, then the
universal quantifier is simply the conjunction of all elements:
29. Examples &
Universal Quantifier
Example I
Predicate
Logic and
Quantifiers
CSE235
Let P(x) be the predicate “x must take a discrete
mathematics course” and let Q(x) be the predicate “x is a
computer science student”.
IntroductionThe
universe of
discourse
for both P(x)
and Q(x) is all PropositionalUNL students.
Functions Express the statement “Every computer science student
Propositional
Functions
Quantifiers
must take a discrete mathematics course”.
30. Transcribing
English into Logic
Further22/ 33
Examples &
Universal Quantifier
Example I
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Express the statement “Everybody must take a discrete
mathematics course or be a computer science student”.
Logic
Programming
31. Examples &
Universal Quantifier
Example I
Predicate
Logic and
Quantifiers
CSE235
Let P(x) be the predicate “x must take a discrete
mathematics course” and let Q(x) be the predicate “x is a
computer science student”.
IntroductionThe universe of discourse for both P(x) and Q(x) is all
PropositionalUNL students.
Functions
Express the statement “Every computer science student
32. Transcribing
English into Logic
Further24/ 33
Examples &
Universal Quantifier
Example I
UniversalQuantifier ∀x(Q(x) → P(x))
Existential Quantifier
Mixing
Quantifiers
Propositional
Functions
Quantifiers
must take a discrete mathematics course”.
33. Examples &
Universal Quantifier
Example I
Binding
Variables
Negation
Express the statement “Everybody must take a discrete
mathematics course or be a computer science student”.
Logic
Programming
Transcribing
English into Logic
Further10 /33
34. Examples &
Universal Quantifier
Example I
Predicate
Logic and
Quantifiers
CSE235
Let P(x) be the predicate “x must take a discrete
mathematics course” and let Q(x) be the predicate “x is a
computer science student”.
IntroductionThe universe of discourse for both P(x) and Q(x) is all
PropositionalUNL students.
Functions
Express the statement “Every computer science student
35. Examples &
Universal Quantifier
Example I
Propositional
Functions
Quantifiers
must take a discrete mathematics course”.
Existential Quantifier
Mixing
Quantifiers
36. Examples &
Universal Quantifier
Example II
UniversalQuantifier ∀x(Q(x) → P(x))
Transcribing
English into Logic
Further10 /33
Predicate
Logic and
Quantifiers
CSE235
Let P(x) be the predicate “x must take a discrete
mathematics course” and let Q(x) be the predicate “x is a
computer science student”.
Binding
Variables
Negation
Logic
Programming
Express the statement “Everybody must take a discrete
mathematics course or be a computer science student”.
∀x(Q(x) ∨ P(x))
37. Examples &
Universal Quantifier
Example I
IntroductionThe universe of discourse for both P(x) and Q(x) is all
PropositionalUNL students.
Functions
Propositional
Functions
Quantifiers
must take a discrete mathematics course”.
Existential Quantifier
Mixing
Quantifiers
38. Examples &
Universal Quantifier
Example II
Express the statement “Every computer science student
UniversalQuantifier ∀x(Q(x) → P(x))
Predicate
Logic and
Binding
Variables
Negation
Logic
Programming
Transcribing
English into Logic
Further10 /33
Express the statement “Everybody must take a discrete
mathematics course or be a computer science student”.
∀x(Q(x) ∨ P(x))
Are hetse statements true or false?
39. Examples &
Universal Quantifier
Example I
Quantifiers
Express the statement “for every x and for every y, x+y > 10”
CSE235
Introduction
Propositional Functions
Propositional Functions
Quantifiers
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
42. Examples &
Universal Quantifier
Example II
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Transcribing
English into Logic
CSE235
Introduction
Propositional
Functions
Express the statement “for every x and for every y, x+y > 10”
Let P(x,y) be the statement x + y > 10 where the universe of
discourse for x,y is the set of integers.
44. Examples &
Universal Quantifier
Example II
Quantifiers
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Logic
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Express the statement “for every x and for every y, x+y > 10”
Let P(x,y) be the statement x + y > 10 where the universe of
discourse for x,y is the set of integers.
Answer:
45. Transcribing
English into Logic
Further13 /33
Examples &
Universal Quantifier
Example II
Programming
Transcribing
English into Logic
Further11 /33
Predicate
Logic and
46. Examples &
Universal Quantifier
Example II
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Express the statement “for every x and for every y, x+y > 10”
Let P(x,y) be the statement x + y > 10 where the universe of
discourse for x,y is the set of integers.
Answer:
∀x∀yP(x,y)
47. Transcribing
English into Logic
Further15 /33
Examples &
Universal Quantifier
Example II
Universal
Quantifier
∀x,yP(x,y)
Logic
Programming
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Note that we can also use the shorthand
49. Transcribing
English into Logic
Further17 /33
Examples &
Existential Quantifier
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Definition
P (x)
x
P (x) is true.” We use the notation
∃xP (x)
which can be read “there exists anx
50. Transcribing
English into Logic
Further18 /33
Examples &
Existential Quantifier
Example II
Mixing
Quantifiers Again, if the universe of discourse is finite, {n1,n2,...,nk}, then
51. Transcribing
English into Logic
Further19 /33
Examples &
Existential Quantifier
Propositional Functions
Quantifiers
Universal
Quantifier
Existential
Quantifier
∃xP(x) ⇐⇒ P(n1) ∨ P(n2) ∨ ··· ∨ P(nk)
Binding
Variables
Negation
Logic
Programming
the existential quantifier is simply the disjunction of all
elements:
52. Transcribing
English into Logic
Further20 /33
Examples &
Existential Quantifier
Example II
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Let P(x,y) denote the statement, “x + y = 5”.
What does the expression,
∃x∃yP(x,y)
53. Transcribing
English into Logic
Further21 /33
Examples &
Existential Quantifier
Example I
Existential mean?
Quantifier
Mixing
Quantifiers
Binding What universe(s) of discourse make it true?
Variables
Negation
Logic
Programming
54. Transcribing
English into Logic
Further22 /33
Examples &
Existential Quantifier
Example II
Predicate
Logic and
Quantifiers
Propositional Functions
Propositional Functions
Quantifiers
Universal
Quantifier
Existential Quantifier
CSE235
Introduction
Express the statement “there exists a real solution to
ax2 + bx − c = 0”
56. Examples &
Existential Quantifier
Example II
Predicate
Logic and
Quantifiers
Propositional
Functions Let P(x) be the statementwhere the universe
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
CSE235
Introduction
Express the statement “there exists a real solution to
ax2 + bx − c = 0”
Propositional
Functions
Quantifiers
of discourse for x is the set of reals. Note here that a,b,c are all
fixed constants.
57. Examples &
Existential Quantifier
Example II Continued
Variables
Negation
Logic
Programming
Transcribing
English into Logic
Further14 /33
Predicate
Logic and
Quantifiers
Propositional
CSE235
Introduction
Express the statement “there exists a real solution to
ax2 + bx − c = 0”
58. Examples &
Existential Quantifier
Example II
Functions Let P(x) be the statementwhere the universe
The statement can thus be expressed as
Existential
Quantifier
Mixing
Propositional
Functions
Quantifiers
Universal
Quantifier
of discourse for x is the set of reals. Note here that a,b,c are all
fixed constants.
59. Examples &
Existential Quantifier
Example II Continued
Quantifiers
Binding
Variables
Negation
∃xP(x)
Logic
Programming
Transcribing
English into Logic
Further14 /33
Predicate
Logic and
Quantifiers
CSE235
Introduction Question: what is the truth value of ∃xP(x)?
Propositional Functions
60. Examples &
Existential Quantifier
Example II
Propositional Functions
Quantifiers
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Transcribing
English into Logic
Further15 /33
61.
62. Examples &
Existential Quantifier
Example II Continued
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Question: what is the truth value of xP(x)?
Answer: it is false. For any real numbers such that b2 < 4ac,
there will only be complex solutions, for these cases no such
real number x can satisfy the predicate.
How can we make it so that it is true?
63. Transcribing
English into Logic
Further15 /33
Examples &
Existential Quantifier
Example II Continued
∃
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
65. Transcribing
English into Logic
Further17 /33
Examples &
Existential Quantifier
Example II Continued
∃
Existential
Quantifier
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Question: what is the truth value of xP(x)?
Answer: it is false. For any real numbers such that b2 < 4ac,
there will only be complex solutions, for these cases no such
real number x can satisfy the predicate.
How can we make it so that it is true?
66. Transcribing
English into Logic
Further18 /33
Examples &
Mixing
Quantifiers
Binding
Variables
Negation
Answer: change the universe of discourse to the complex
numbers, C.
Logic
Programming
67. Transcribing
English into Logic
Further19 /33
Examples &
Existential Quantifier
Example II Continued
Quantifiers
Truth Values
Functions
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
In general, when are quantified statements true/false?
Statement True When False When
68. Transcribing
English into Logic
Further20 /33
Examples &
Propositional
Functions
Quantifiers
Universal
Quantifier
Existential Quantifier
Mixing
Logic
Programming
∀xP(x) P(x) is true for every
x.
There is an x for which
P(x) is false.
∃xP(x) There is an x for which
P(x) is true.
P(x) is false for every
x.
Quantifiers
Binding
Variables
Negation
Table: Truth Values of Quantifiers
70. Transcribing
English into Logic
Further22 /33
Examples &
Mixing Quantifiers
I
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Existential
Quantifier
Existential and universal quantifiers can be used together to
quantify a predicate statement; for example,
∀x∃yP(x,y)
is perfectly valid. However, you must be careful—it must be
read left to right.
71. Transcribing
English into Logic
Further23 /33
Examples &
Mixing Quantifiers
Mixing
Quantifiers
Logic
Programming
II
Binding
Variables
Negation
For example, ∀x∃yP(x,y) is not equivalent to ∃y∀xP(x,y).
Thus, ordering is important.
72. Transcribing
English into Logic
Further24 /33
Examples &
Mixing Quantifiers
Predicate Logic
and
Quantifiers
CSE235
For example:
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Existential
Quantifier
Those expressions do not mean the same thing!
Note that ∃y∀xP(x,y) → ∀x∃yP(x,y), but the converse does not
hold
74. Transcribing
English into Logic
Further26 /33
Examples &
Mixing Quantifiers
Introduction∀x∃yLoves(x,y): everybody loves somebody
Propositional∃y∀xLoves(x,y): There is someone loved by everyone
Variables
Negation
Logic
Programming
equivalent to ∃y∃xP(x,y) (which is why our shorthand was
valid).
76. Transcribing
English into Logic
Further28 /33
Examples &
Mixing Quantifiers
∀x∀yP(x,y) P(x,y) is true for every
pair x,y.
There is at least one
pair, x,y for which
P(x,y) is false.
∀x∃yP(x,y) For every x, there is a
y for which P(x,y) is
true.
There is an x for which
P(x,y) is false for
every y.
77. Transcribing
English into Logic
Further29 /33
Examples &
Mixing Quantifiers
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Existential Quantifier
∃x∀yP(x,y) There is an x for which
P(x,y) is true for every
y.
For every x, there is a
y for which P(x,y) is
false.
∃x∃yP(x,y) There is at least one
pair x,y for which
P(x,y) is true.
P(x,y) is false for every
pair x,y.
78. Transcribing
English into Logic
Further30 /33
Examples &
Mixing Quantifiers
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Table: Truth Values of 2-variate Quantifiers
79. Transcribing
English into Logic
Further31 /33
Examples &
Mixing Quantifiers
Example I
Predicate
Logic and
Quantifiers
CSE235
Express, in predicate logic, the statement that there are an
Introduction infinite number of integers.
Propositional Functions
Propositional Functions
Quantifiers
Universal
Quantifier
80. Examples &
Mixing Quantifiers
Example I
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Predicate
Logic and
Quantifiers
CSE235
Quantifiers
81. Examples &
Mixing Quantifiers
Example I
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Introduction
Propositional
Functions
Propositional
Functions
Express, in predicate logic, the statement that there are an
infinite number of integers.
Let P(x,y) be the statement that x < y. Let the universe of
discourse be the integers, Z.
83. Examples &
Mixing Quantifiers
Example I
CSE235
Mixing ∀x∃yP(x,y)
Quantifiers
Binding
Variables
Negation
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Existential
Quantifier
Express, in predicate logic, the statement that there are an
infinite number of integers.
Let P(x,y) be the statement that x < y. Let the universe of
discourse be the integers, Z.
Then the statement can be expressed by the following.
85. Transcribing
English into Logic
Further21 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements
Predicate
Logic and
Quantifiers
CSE235 Express the commutative law of addition for R.
Introduction
Propositional Functions
Propositional Functions
Quantifiers
Universal
Quantifier
86. Transcribing
English into Logic
Further21 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Predicate
Logic and
87. Transcribing
English into Logic
Further21 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Express the commutative law of addition for R.
We want to express that for every pair of reals, x,y the
following identity holds:
x + y = y + x
88. Transcribing
English into Logic
Further21 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements
Quantifiers
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Predicate
Logic and
89. Transcribing
English into Logic
Further21 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Existential
Quantifier
Express the commutative law of addition for R.
We want to express that for every pair of reals, x,y the
following identity holds:
x + y = y + x
Then we have the following:
90. Transcribing
English into Logic
Further21 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements
Mixing
QuantifiersBinding ∀x∀y(x + y = y + x)
Variables
Negation
Logic
Programming
91. Transcribing
English into Logic
Further22 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements Continued
Predicate
Logic and
Quantifiers
CSE235
Express the multiplicative inverse law for (nonzero) rationals
Introduction
Q {0}.
Propositional Functions
Propositional Functions
Quantifiers
92. Transcribing
English into Logic
Further22 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements Continued
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Predicate
Logic and
Quantifiers
93. Transcribing
English into Logic
Further22 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements Continued
CSE235
Quantifiers
Universal
Quantifier
Existential Quantifier
Mixing
Introduction
Propositional
Functions
Propositional
Functions
Express the multiplicative inverse law for (nonzero) rationals Q
{0}.
We want to express that for every real number x, there exists a
real number y such that xy = 1.
94. Transcribing
English into Logic
Further22 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements Continued
Quantifiers
Binding
Variables
Negation
Logic
Programming
Predicate
Logic and
Quantifiers
95. Transcribing
English into Logic
Further22 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements Continued
CSE235
Mixing ∀x∃y(xy = 1)
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Existential
Quantifier
Express the multiplicative inverse law for (nonzero) rationals Q
{0}.
We want to express that for every real number x, there exists a
real number y such that xy = 1.
Then we have the following:
96. Transcribing
English into Logic
Further22 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements Continued
Quantifiers
Binding
Variables
Negation
Logic
Programming
97. Transcribing
English into Logic
Further23 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements
Predicate
Logic and
Quantifiers
CSE235
Introduction Is commutativity for subtraction valid over the reals?
Propositional Functions
Propositional Functions
Quantifiers
Universal
Quantifier
Existential Quantifier
98. Transcribing
English into Logic
Further23 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Predicate
Logic and
Quantifiers
99. Transcribing
English into Logic
Further23 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements
CSE235
Quantifiers
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
Introduction
Propositional
Functions
Propositional
Functions
Is commutativity for subtraction valid over the reals?
That is, for all pairs of real numbers x,y does the identity x −
y = y − x hold? Express this using quantifiers.
100. Transcribing
English into Logic
Further23 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements
Variables
Negation
Logic
Programming
Predicate
Logic and
Quantifiers
101. Transcribing
English into Logic
Further23 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements
CSE235
Mixing
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Existential
Quantifier
Is commutativity for subtraction valid over the reals?
That is, for all pairs of real numbers x,y does the identity x −
y = y − x hold? Express this using quantifiers.
The expression is
∀x∀y(x − y = y − x)
102. Transcribing
English into Logic
Further23 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements
Quantifiers
Binding
Variables
Negation
Logic
Programming
103. Transcribing
English into Logic
Further24 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements Continued
Predicate
Logic and
Quantifiers
CSE235
Introduction Is there a multiplicative inverse law over the nonzero integers?
Propositional Functions
Propositional Functions
Quantifiers
Universal
Quantifier
Existential Quantifier
104. Transcribing
English into Logic
Further24 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements Continued
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Predicate
Logic and
Quantifiers
CSE235
105. Transcribing
English into Logic
Further24 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements Continued
Functions
Quantifiers
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
Introduction
Propositional
Functions
Propositional
Is there a multiplicative inverse law over the nonzero integers?
That is, for every integer x does there exists a y such that xy =
1?
106. Transcribing
English into Logic
Further24 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements Continued
Variables
Negation
Logic
Programming
Predicate
Logic and
Quantifiers
107. Transcribing
English into Logic
Further24 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements Continued
CSE235
Mixing statement held, then 5 = 1/y, but for any (nonzero) integer y,
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Existential
Quantifier
Is there a multiplicative inverse law over the nonzero integers?
That is, for every integer x does there exists a y such that xy =
1?
This is false, since we can find a counter example. Take any
integer, say 5 and multiply it with another integer, y. If the
108. Transcribing
English into Logic
Further24 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements Continued
Quantifiers
Binding Variables
|1/y| ≤ 1.
Negation
Logic
Programming
109. Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
Logic andPredicate Express the statement “there is a number x such that
Quantifiers when it is added to any number, the result is that CSE235
number, and if it is multiplied by any number, the Introduction
result is x” as a logical expression.
Propositional Functions
Propositional Solution:
Functions
111. Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
Quantifiers
Binding
Variables
Negation
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Express the statement “there is a number x such that
when it is added to any number, the result is that
number, and if it is multiplied by any number, the
result is x” as a logical expression.
Solution:
Let P(x,y) be the expression “x + y = y”.
112. Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
Logic
Programming
QuantifiersLet P(x,y) be the expression “x + y = y”.
UniversalQuantifierLet Q(x,y) be the expression “xy = x”.
Existential Quantifier
Mixing
113. Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
Quantifiers
Binding
Variables
Negation
Logic
Programming
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Express the statement “there is a number x such that
when it is added to any number, the result is that
number, and if it is multiplied by any number, the
result is x” as a logical expression.
Solution:
114. Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
QuantifiersLet P(x,y) be the expression “x + y = y”.
UniversalQuantifierLet Q(x,y) be the expression “xy = x”.
ExistentialQuantifierThen the expression is
Mixing
115. Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
Quantifiers
Binding Variables
∃x∀y (P(x,y) ∧ Q(x,y))
Negation
Logic
Programming
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Express the statement “there is a number x such that
when it is added to any number, the result is that
number, and if it is multiplied by any number, the
result is x” as a logical expression.
Solution:
117. Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Express the statement “there is a number x such that
when it is added to any number, the result is that
number, and if it is multiplied by any number, the
result is x” as a logical expression.
Solution:
119. Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
UniversalQuantifierLet Q(x,y) be the expression “xy = x”.
ExistentialQuantifierThen the expression is
Mixing
Quantifiers
Variables
Negation
Logic
Programming
Over what universe(s) of discourse does this statement
hold?
120. Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
QuantifiersLet P(x,y) be the expression “x + y = y”.
UniversalQuantifierLet Q(x,y) be the expression “xy = x”.
ExistentialQuantifierThen the expression is
Mixing
121. Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
Quantifiers
Binding
Variables
Negation
∃x∀y (P(x,y) ∧ Q(x,y))
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Express the statement “there is a number x such that
when it is added to any number, the result is that
number, and if it is multiplied by any number, the
result is x” as a logical expression.
Solution:
122. Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
LogicOver what universe(s) of discourse does this statement
Programming
hold?
This is the additive identity law and holds for N,Z,R,Q but
does not hold for Z+.
123. Examples &
Binding Variables I
Propositional
Functions Example
Quantifiers In the expression ∃x∀yP(x,y) both x and y are bound.
Universal
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
When a quantifier is used on a variable x, we say that x is
bound. If no quantifier is used on a variable in a predicate
statement, it is called free.
124. Examples &
QuantifierExistential In the expression ∀xP(x,y), x is bound, but y is free.
Quantifier
Mixing
Quantifiers
BindingVariables A statement is called a well-formed formula, when all variables
Negation
are properly
quantified.
Logic
Programming
Transcribing
English into Logic
Further26 /33
125. Examples &
Binding Variables II
Propositional Example
Functions
Quantifiers In the expression ∃x,y∀zP(x,y,z,c) the scope of the
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
The set of all variables bound by a common quantifier is the
scope of that quantifier.
126. Examples &
UniversalQuantifier existential quantifier is {x,y}, the scope of the universal
ExistentialQuantifier quantifier is just z and c has no scope since it is free.
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Transcribing
English into Logic
Further27 /33
131. Examples &
This is essentially a quantified version of De Morgan’s Law (in
Further28 /33
Negation
Truth Values
Predicate
Logic and
Quantifiers
CSE235
Introduction
Statement True When False When
133. Prolog
FunctionsProlog allows the user to express facts and rules
PropositionalFacts are proposational functions: student(juana),
Functions
enrolled(juana,cse235),
instructor(patel,cse235),
etc.
Quantifiers
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Prolog (Programming in Logic) is a programming language
based on (a restricted form of) Predicate Calculus. It was
developped by the logicians of the artificial intelligence
community for symbolic reasoning.
Logic
Further
Examples &
Exercises
?enrolled(juana,cse478)
?enrolled(X,cse478)
?teaches(X,juana)
134. Rules are implications with conjunctions:
Logic Programming teaches(X,Y) :- instructor(X,Z), enrolled(Y,Z)
Transcribing
English intoProlog answers queries such as:
30 /33
by binding variables and doing theorem proving (i.e.,
applying inference rules) as we will see in Section 1.5.
137. 32 /33
Conclusion
English into Logic
everyone is fierce”
Transcribing
English into
Logic Use ∃ with ∧
Examples &
Exercises have at least one lion that drinks coffee
143. 32 /33
Conclusion
Quantifiers
Logic
“”. When is Q(y) true?
Predicate Logic
and
Quantifiers
CSE235
Examples? Exercises?
Rewrite the expression,
Introduction
Propositional Functions
Answer: Use the negated quantifiers and De Morgan’s law.
Logic
Programming
Transcribing
English into
Let P(x,y) denote “x is a factor of y” where x ∈ {1,2,3,...}
and y ∈ {2,3,4,...}. Let Q(y) denote
144. Propositional Functions
Quantifiers
Logic
“”. When is Q(y) true?
Answer: Only when y is a prime number.
Further
Examples &
Exercises
Logic
Programming
Transcribing
English into
Let P(x,y) denote “x is a factor of y” where x ∈ {1,2,3,...}
and y ∈ {2,3,4,...}. Let Q(y) denote
146. Extra Question
Further Examples &
Exercises Thus, the left-hand side is a proposition, but the right-hand side
is not. How can they be equivalent?
33 /33