Predicate Logic, Universal and Existential
Quantifiers
(述語論理、全称限量子、存在限量子)
Discrete Mathematics I
7th lecture, November 9, 2018
http://www.sw.it.aoyama.ac.jp/2018/Math1/lecture7.html
Martin J. Dürst
© 2005-18 Martin
J. Dürst Aoyama Gakuin
University
Today's Schedule
- Schedule for the next few weeks
- Leftovers/summary/homework for last lecture
- Predicates and predicate logic
- Quantifiers
- Laws for Quantifiers
- This week's homework
Schedule for the Next Few Weeks
- November 9: Predicate Logic, Quantifiers
- November 16: Applications of Predicate Logic
- November 23: No lectures (Labor Thanksgiving Day)
- November 30: Relations
Announcement
There will be a minitest (ca. 30minutes) on November 30.
Please start to prepare early!
Leftovers of Last Lecture
Summary of Last Lecture
- There are many different kinds of symbolic logic: Propositional logic,
predicate logic,...
- Predicates take arguments (propositions do not take arguments)
- Predicate logic allows more general statements and inferences than
propositional logic
- Predicate logic uses universal quantifiers (∀) and existential
quantifiers (∃)
Homework Due November 1, Problem 1
Sorry, it was removed! :)
Homework Due November 1, Problem 2
Sorry, it was removed! :)
Homework Due November 8, Problems 1/2
Sorry, it was removed! :)
Homework Due November 8, Problems 3/4
Sorry, it was removed! :)
Homework Due November 8, Problem 5
Sorry, it was removed! :)
Homework Due November 8, Problem 6
Sorry, it was removed! :)
Comments on Homework Corrections
(Homework due October 25)
- Problem 1: 60points, problem 2: 40 points
- Problem 1 details:
1 point deduction for formula that is longer than necessary
(e.g. NAND(NAND(B)) instead of B)
- Problem 2 details:
15 points deduction for completely wrong circuit
10 points deduction for general errors (wrong gate, wrong priority)
5 points deduction for inconsequential errors (e.g. NOR(OR(A, B), C)
instead of NOR(A, B, C))
5 points deduction for significant size variations (all gates should be of
same size, except for NOT gate, which is about half the size of the
others)
5 points for missing legends, incomplete connections, bad shapes (e.g. OR
gate as triangle)
About Returns of Tests and Homeworks
- Today, the graded homeworks due October 25 will be returned
- This is not part of the lecture itself (i.e. after 12:30)
- If you have some other commitment after 12:30, you can come to my office
in the afternoon to pick up your homework
- Homeworks with names in kana will be distributed first, then those
without kana
- Homeworks with higher points will be distributed before those with lower
points
- When your name is called, immediately and very clearly raise your hand,
and come to the front
- When taking your homework, make sure it is really yours
- NEVER take the homework of somebody else (a friend,...)
- Carefully analize your mistakes and work on fixing them and avoiding them
in the future
Types of Symbolic Logic
- Binary (Boolean) logic (using only true and false)
- Multi-valued logic (using e.g. true, false, and unknown)
- Fuzzy logic (including calculation of ambiguity)
- Propositional logic (using only prepositions)
- Predicate logic (first order predicate logic,...)
- Temporal logic (integrating temporal relationships)
Limitations of Propositions
With propositions, related statements have to be made separately
Examples:
Today it is sunny. Tomorrow it is sunny. The day after tomorrow, it is
sunny.
2 is even. 5 is even.
We can express "If today is sunny, then tomorrow will also be sunny." or "If
2 is even, then 3 is not even".
But we cannot express "If it's sunny on a given day, it's also sunny on the
next day." or "If x is even, then x+2 is also even.".
Predicates
- The problem with propositions can be solved by introducing
predicates .
- In the same way as propositions, predicates are objectively true or
false.
- A predicate is a function (with 0 or more arguments) that returns true or
false.
- If the value of an argument is undefined, the result (value) of the
predicate is unknown.
- A predicate with 0 arguments is a proposition.
How to Write Predicates
There are two ways to write predicates:
- Functional notation:
- The name of the predicate is the name of the function
- Arguments are enclosed in parentheses after the function name
- Each predicate has a fixed number of arguments
- Arguments in different positions have different meanings
- Examples:
sunny(today): It is sunny today
even(4): 4 is even
parent(Ieyasu, Hidetada): Ieyasu is the parent of Hidetada
- Reading of predicates depends on their meaning
- Operator notation:
- Operators that return true or false can be used as predicates
- Examples: 3 < 7, 5 ≧ 2, a ∈ B,
even(x) ∨ odd(y)
Formulas Containing Predicates
Using predicates, we can express new things:
- sunny(x) → sunny(day after x)
- even(y) → even(y+2)
- even(z) → odd(z+1)
Similar to propositions, predicates can be true or false.
But predicates can also be unknown/undefined, for example if they contain
variables.
Also, even if a predicate is undefined (e.g. even( x)),
a formula containing this predicate can be defined
(true, e.g. even(y) → even(y+2), or false, e.g.
odd(z) → even(z+24))
First Order Predicate Logic
- The arguments of predicates can be constants, functions (including other
predicates), formulæ,...
Examples:
- even(2), say(Romeo, 'I love you'), parent(Ieyasu, Hidetada)
- even(sin(0)), even(2+3×7)
- However, it is not possible to use predicates within predicates
Counterexample: say(z, parent(y,
x))
(z says "y is the father of x")
- Higher-order logic allows predicates within predicates
Example: ∀n∈ℕ: even (n) →
even(n+2)
Readings:
- For all n, elements of ℕ, if n is even, then
n+2 is even.
- For all natural numbers n, if n is even, then
n+2 is even.
General form: ∀x: P (x)
∀ is the A of "for All", inverted.
Readings in Japanese:
- 全ての自然数 n において、n
が偶数ならば n+2 も偶数である
- 任意の x において、P(x)
Universal Quantifier for the Empty Set
∀x∈{}: P(x) = T
Reason:
We have to check P(x) for all elements x in the set.
If we find just one x where P(x) is false, the overall
statement is false.
But we cannot find any x where P(x) is false.
Therefore, ∀x∈{}: P(x) is always true
Application example:
All students in this room from Hungary are over 50 (years old).
∀s∈S: native(s, Hungary) →age(s) >
50
See: Vacuous truth, https://en.wikipedia.org/wiki/Vacuous_truth
Knowledge about Field of Application
Existential Quantifier
Example: ∃n∈ℕ: odd (n)
Readings:
- There exists a n, element of ℕ, for which n is
odd.
- There is a natural number n so that n is odd.
- There exists a natural number n which is odd.
- There exists an odd natural number.
General form: ∃y: P (y)
∃ is the mirrored form of the E in "there
Exists".
Readings in Japanese:
- P(y) が成立する y が存在する
- ある y について、P(y)
Structure of Quantifier Expressions
Example: ∀m, n∈ℕ: m > n
→ m^{2} ≧ n^{2}
- ∀: Quantifier
- m, n: Variable(s), separated by commas
- ∈ℕ: Set membership (applies to all previous variables; unnecessary if
universal set is obvious)
- ":": Colon
- m > n → m^{2} ≧
n^{2}: Quantified predicate
More Quantifier Examples
∀n∈ℕ: n + n + n =
3n
∃n∈ℕ: n^{2} =
n^{3}
∃n∈ℝ: n^{2} < 50n <
n^{3}
∀m, n∈ℕ: 7m + 2n =
2n + 7m
Peano Axioms in Predicate Logic
Peano Axioms (Guiseppe Peano, 1858-1932)
- 1∈ℕ
- ∀a∈ℕ: s(a)∈ℕ
- ¬∃x∈ℕ: s(x) = 1
- ∀a, b∈ℕ: a ≠ b →
s(a) ≠ s(b)
- P(1) ∧ (∀k∈ℕ:
(P(k)→P(s(k)))) ⇒
∀a∈ℕ: P(a)
The Use of Variables with Quantifiers
- Bound variable:
- Variable quantified by a quantifier
Example: the x in: ∀x:
(P(x)∧Q(y))
- Free variable:
- Variable not quantified by a quantifier
Example: the y in: ∀x:
(P(x)∧Q(y))
- Closed formula:
- A formula without free variables.
- Scope:
- The part of a formula where a bound variable (or a quantifier) is
active.
All occurrences of a bound variable within its scope can be exchanged by
another variable.
Example: ∀s: (age(s)≤30 ∧
college(s)=CSE) ⇔ ∀u: (age(u)≤30
∧ college(u)=CSE)
Using a bound variable outside its scope is an error.
Example: (∀x: P(x))∧Q(x)
Manipulation of Bound Variables
∀s: age(s)≤30) ∧ (∀t:
college(t)=CSE) = ∀u:
(age(u)≤30∧college(u)=CSE)
is the same as
∀s: age(s)≤30) ∧ (∀s: college(s)=CSE) = ∀s: (age(s)≤30∧college(s)=CSE)
There are three different variables s in the last
statement.
Advice:
- It is better to use different variable names with each
quantifier, but
- You have to understand formuæ that repeatedly used the same
variable name.
- Bound variables are similar to local variables in programming
languages.
Important Points for Quantifiers
- What is the universal
set?
(Example: ∀i ∈ℕ^{+}: i>0)
- Notation (colons, parentheses)
- Definition of used predicates
- Free vs. bound variables
Laws for Quantifiers
- ¬∀x: P(x) = ∃x:
¬P(x)
- ¬∃x: P(x) = ∀x:
¬P(x)
- (X≠{}∧∀x∈X: P(x)) →
(∃x: P(x))
- (∀x: P(x)) ∧ Q(y) = ∀x:
P(x)∧Q(y)
- (∃x: P(x)) ∧ Q(y) = ∃x:
P(x)∧Q(y)
- (∀x: P(x)) ∨ Q(y) = ∀x:
P(x)∨Q(y)
- (∃x: P(x)) ∨ Q(y) = ∃x:
P(x)∨Q(y)
- (∀x: P(x)) ∧ (∀x: R(x))
= ∀x: P(x)∧R(x)
- (∀x: P(x)) ∨ (∀x: R(x))
⇒ ∀x: P(x)∨R(x)
- (∃x: P(x)) ∨ (∃x: R(x))
= ∃x: P(x)∨R(x)
- (∃x: P(x)) ∧ (∃x: R(x))
⇐ ∃x: P(x)∧R(x)
- (∃y: ∀x: P(x, y)) ⇒
(∀x: ∃y: P(x, y))
- P(x) is a tautology ⇔∀x: P(x) is a
tautology
Combination of Quantifiers
(∃y: ∀x: P(x, y)) →
(∀x: ∃y: P(x, y))
(∀x: ∃y: P(x, y)) ↛
(∃y: ∀x: P(x, y))
The number of prime numbers is infinite.
(This means that whatever big number x we choose, there will
always be a bigger prime number y.)
∀x: ∃y: (y > x ∧
prime(y))
Reversing the order of the quantifiers changes the meaning:
∃y: ∀x: (y > x ∧
prime(y))
(There is a prime number y that is bigger than any (natural
number) x. This statement is obviously false.)
Proof that the Number of Prime Numbers is Infinite
- Assume there is a largest prime number z:
∃z: prime(z) ∧ ∀y:
prime(y) → y≤z
- Calculate a new number t = 1 +
∏^{z}_{p}_{=2}(prime(p))
p
Example: z=7; t = 1 + 2·3·5·7 = 211
- ∀x≤z: prime(x)→t mod
x =1 ⇒
∃s: (z<s≤t
∧ prime(s)) ⇒
∃y: (y > x ∧
prime(y))
This Week's Homework 1
Deadline: November 15, 2017 (Thursday), 19:00.
Format: Handout, easily readable handwriting
Where to submit: Box in front of room O-529 (building O, 5th floor)
Problems: See handout
Glossary
- predicate logic
- 述語論理
- quantifier
- 限量子
- evaluate
- 評価する
- evaluation
- 評価
- array
- 配列
- tautology
- 恒真 (式)、トートロジー
- contradiction
- 恒偽 (式)
- symbolic logic
- 記号論理
- multi-valued logic
- 多値論理
- fuzzy logic
- ファジィ論理
- ambiguity
- 曖昧さ
- first-order predicate logic
- 一階述語論理
- temporal logic
- 時相論理
- binary logic
- 二値論理
- generalization
- 一般化
- argument
- 引数
- undefined
- 未定
- higher-order logic
- 高階述語論理
- universal quantifier
- 全称限量子 (全称記号)
- existential quantifier
- 存在限量子 (存在記号)
- inference
- 推論
- College of Science and Engineering
- 理工学部
- native of ...
- ...出身
- bound variable
- 束縛変数
- free variable
- 自由変数
- local variable
- 局所変数
- closed formula
- 閉論理式
- scope
- 作用領域、スコープ
- prime number
- 素数