Predicate Logic, Universal and Existential Quantifiers

(述語論理、全称限量子、存在限量子)

Discrete Mathematics I

7th lecture, November 15, 2019

https://www.sw.it.aoyama.ac.jp/2019/Math1/lecture7.html

Martin J. Dürst

AGU

© 2005-19 Martin J. Dürst Aoyama Gakuin University

Today's Schedule

 

Announcement

There will be a minitest (ca. 30minutes) on November 29. Please start to prepare early!

 

Leftovers of Last Lecture

Summary of Last Lecture

 

Homework Due November 7, Problem 1

Prove/check the following laws using truth tables (important: Always add a sentence stating the conclusion):

  1. Reductio ad absurdum: A→¬A = ¬A
    A ¬A A→¬A
    F T T
    T F F

    Because the columns for ¬A and A→¬A are the same, this law is correct.

  2. Contraposition: AB = ¬B→¬A
    A B AB ¬B ¬A ¬B→¬A (AB) ↔(¬B→¬A)
    F F T T T T T
    F T T F T T T
    T F F T F F T
    T T T F F T T

    Because the column for (AB) ↔(¬B→¬A) is all Ts, this law is correct.

  3. The associative law for conjunction: (AB) ∧ C = A ∧  (BC)
    A B C AB (AB) ∧ C BC A ∧ (BC)
    F F F F F F F
    F F T F F F F
    F T F F F F F
    F T T F F T F
    T F F F F F F
    T F T F F F F
    T T F T F F F
    T T T T T T T

    Because the columns for (AB) ∧ C  and A ∧  (BC) are the same, this law is correct.

  4. One of De Morgan's laws: ¬(AB) = ¬A ∨ ¬B
    A B AB ¬(AB) ¬A ¬B
    ¬A ∨ ¬B
    F F F T T T T
    F T F T T F T
    T F F T F T T
    T T T F F F F

    Because the columns for ¬(AB) and ¬A ∨ ¬B are the same, this law is correct.

 

Homework Due November 7, Problem 2

Prove transitivity of implication (((AB) ∧ (BC)) ⇒ (AC)) by formula manipulation.

For each simplification step, indicate which law you used.

Hint: Show that ((AB) ∧ (BC)) → (AC) is a tautology by simplifying it to T.

((AB) ∧ (BC)) → (AC) [removing implication]
= ¬((AB) ∧ (BC))∨ (AC) [removing implication, 3 times]
= ¬((¬AB) ∧ (¬BC)) ∨ (¬AC) [DeMorgan]
= (¬(¬AB) ∨ ¬(¬BC)) ∨ (¬AC) [DeMorgan, twice]
= ((¬¬A∧¬B) ∨ (¬¬B∧¬C)) ∨ (¬AC) [double negation, twice]
= ((A∧¬B) ∨ (B∧¬C)) ∨ (¬AC) [associative/commutative laws]
= (A∧¬B) ∨ ¬A ∨ (B∧¬C) ∨ C [distributive law, twice]
= (A∨¬A)∧(¬B∨¬A) ∨ (BC) ∧ (¬CC) [law of excluded middle, twice]
= T ∧ (¬B∨¬A) ∨ (BC) ∧ T [property of true, twice]
= (¬B∨¬A) ∨ (BC) [associative/commutative laws]
= ¬AB∨¬BC [law of excluded middle]
= ¬A ∨ T ∨ C [property of true, twice]
= T ∴

 

Homework Due November 14, Problems 1/2

1. Create a set with four elements. If you use the same elements as other students, a deduction of points will be applied.

Example: {cat, cow, crow, camel}

2. Create the powerset of the set you created in problem 1.

Example: {{}, {cat}, {cow}, {crow}, {camel}, {cat, cow}, {cat, crow}, {cat, camel}, {cow, crow}, {cow, camel}, {crow, camel}, {cat, cow, crow}, {cat, cow, camel}, {cat, crow, camel}, {cow, crow, camel}, {cat, cow, crow, camel}}

 

Homework Due November 14, Problems 3/4

3. For sets A of size zero to six, create a table of the sizes of the powersets (|P(A)|).

|A| |P(A)|
0 1
1 2
2 4
3 8
4 16
5 32
6 64

4. Express the relationship between the size of a set A and the size of its powerset P(A) as a formula.

|P(A)| = 2|A|

 

Homework Due November 14, Problem 5

5. Explain the reason behind the formula in problem 4.

The formula is correct for |A|=0: A={}, P(A)={{}}, |P(A)|=20=1

If the formula is correct for |A|=k (i.e. |P(A)|=2k),
we can show that it is correct for B with |B|=k+1

Example: A={cat, cow}, |A|=2, P(A) = {{}, {cat}, {cow}, {cat, cow}}, |P(A)|=4
B = A∪{carp}={cat, cow, carp}, |B|=3, P(B) = P(A)∪{a∪{carp}|aP(A)}
=P(A)∪{{carp}, {cat, carp}, {cow, carp}, {cat, cow, carp}}

|P(B)| = 2·|P(A)| = 8

General case:

B = {c|cAc=ddA},
|B| = k+1 = |A|+1,
P(B)=P(A)∪{e∪{d}|eP(A)},
|P(B)|=2·|P(A)| = 2·2k=2k+1

(Let B be the set consisting of the elements of A and one additional element d which is not contained in A.
The size of B is one greater than the size of A.
Then the powerset of B is the union of two distinct sets: the powerset of A, and the set of sets from the powerset of A with d added.
The size of the powerset of B is therefore double the size of the powerset of A.)

 

Homework Due November 14, Problem 6

6. Create a table that shows, for sets A of size zero to five, and for each n (size of sets in P(A)), the number of such sets.

|A| n |{B|BA∧|B|=n}| |A| n |{B|BA∧|B|=n}|
0 0 1 4 0 1
1 0 1 4 1 4
1 1 1 4 2 6
2 0 1 4 3 4
2 1 2 4 4 1
2 2 1 5 0 1
3 0 1 5 1 5
3 1 3 5 2 10
3 2 3 5 3 10
3 3 1 5 4 5
5 5 1

 

Types of Symbolic Logic

 

Limitations of Propositions

With propositions, related statements have to be made separately

Examples:
2 is even. 5 is even.
Today it is sunny. Tomorrow it is sunny. The day after tomorrow, it is sunny.

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.".

⇒ This problem can be solved using predicates

 

Examples of Predicates

 

Predicate Overview

 

How to Write Predicates

There are two ways to write predicates:

  1. Functional notation:
  2. Operator notation:

 

Formulas Containing Predicates

Using predicates, we can express new things:

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 have a defined value (true or false)
(e.g. even(y) → even(y+2), or odd(z) → even(z+24))

 

First Order Predicate Logic

 

Universal Quantifier

Example: ∀n∈ℕ: even(n) → even(n+2)

Readings:

General form: ∀x: P (x)

∀ is the A of "for All", inverted.

Readings in Japanese:

 

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).
sS: 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:

General form: ∃y: P (y)

∃ is the mirrored form of the E in "there Exists".

Readings in Japanese:

 

Structure of Quantifier Expressions

Example: ∀m, n∈ℕ: m > nm2n2

 

More Quantifier Examples

n∈ℕ: n + n + n = 3n

n∈ℕ: n2 = n3

n∈ℝ: n2 < 50n < n3

m, n∈ℕ: 7m + 2n = 2n + 7m

 

Applied Quantifier Examples

S: Set of students

F: Set of foods

like(p, f): Person p likes food f

All students like all foods:

Some students like all foods:

There is a food that all students like:

There is no food that all students like:

Each student dislikes a food:

 

Peano Axioms in Predicate Logic

Peano Axioms (Guiseppe Peano, 1858-1932)

  1. 1∈ℕ
  2. a∈ℕ: s(a)∈ℕ
  3. ¬∃x∈ℕ: s(x) = 1
  4. a, b∈ℕ: abs(a) ≠ s(b)
  5. 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: ∀sS: (age(s)≤30 ∧ college(s)=CSE) ⇔ ∀uS: (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

(∀sS: age(s)≤30) ∧ (∀tS: college(t)=CSE) = ∀uS: (age(u)≤30∧college(u)=CSE)

is the same as

(∀sS: age(s)≤30) ∧ (∀sS: college(s)=CSE) = ∀sS: (age(s)≤30∧college(s)=CSE)

There are three different variables s in the last statement.

Advice:

 

Important Points for Quantifiers

 

Laws for Quantifiers

  1. ¬∀x: P(x) = ∃x: ¬P(x)
  2. ¬∃x: P(x) = ∀x: ¬P(x)
  3. (X≠{}∧∀xX: P(x)) → (∃x: P(x))
  4. (∀x: P(x)) ∧ Q(y) = ∀x: P(x)∧Q(y)
  5. (∃x: P(x)) ∧ Q(y) = ∃x: P(x)∧Q(y)
  6. (∀x: P(x)) ∨ Q(y) = ∀x: P(x)∨Q(y)
  7. (∃x: P(x)) ∨ Q(y) = ∃x: P(x)∨Q(y)
  8. (∀x: P(x)) ∧ (∀x: R(x)) = ∀x: P(x)∧R(x)
  9. (∀x: P(x)) ∨ (∀x: R(x)) ⇒ ∀x: P(x)∨R(x)
  10. (∃x: P(x)) ∨ (∃x: R(x)) = ∃x: P(x)∨R(x)
  11. (∃x: P(x)) ∧ (∃x: R(x)) ⇐ ∃x: P(x)∧R(x)
  12. (∃y: ∀x: P(x, y)) ⇒ (∀x: ∃y: P(x, y))
  13. 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

  

Summary

 

This Week's Homework 1

Deadline: November 21, 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
素数