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

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

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

- Schedule for the next few weeks
- Leftovers/summary/homework for last lecture
- Predicates and predicate logic
- Quantifiers
- Laws for Quantifiers
- This week's homework

*Set*s are one of the most basic kinds of objects in Mathematics- Sets are unordered, and do not contain any repetitions
- There are two notations for sets:
*Connotation*(e.g. {1, 2, 3, 4}) and*denotation*(e.g. {`n`|`n`∈ ℕ,`n`>0,`n`<5}) - Operations on sets include
*union*,*intersection*,*difference*, and*complement* - The empty set is a subset of any set
- The powerset of a set is the set of all subsets
- The laws for sets are very similar to the laws for predicate logic

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

- 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. - Contraposition:
`A`→`B`= ¬`B`→¬`A`

`A``B``A`→`B`¬ `B``¬``A``¬``B`→¬`A`( `A`→`B`) ↔(`¬`)`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 (

`A`→`B`) ↔(`¬`) is all Ts, this law is correct.`B`→¬`A` - The associative law for conjunction:
(
`A`∧`B`) ∧`C`=`A`∧ (`B`∧`C`)

`A``B``C``A`∧`B`( `A`∧`B`) ∧`C``B`∧`C``A`∧ (`B`∧`C`)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 (

`A`∧`B`) ∧`C`and`A`∧ (`B`∧`C`) are the same, this law is correct. - One of De Morgan's laws:
¬(
`A`∧`B`) = ¬`A`∨ ¬`B`

`A``B``A`∧`B`¬( `A`∧`B`)¬ `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 ¬(

`A`∧`B`) and ¬`A`∨ ¬`B`are the same, this law is correct.

Prove transitivity of implication (((`A`→`B`) ∧
(`B`→`C`)) ⇒ (`A`→`C`)) by formula
manipulation.

For each simplification step, indicate which law you used.

Hint: Show that ((`A`→`B`) ∧
(`B`→`C`)) → (`A`→`C`) is a tautology
by simplifying it to T.

((`A`→`B`) ∧ (`B`→`C`)) →
(`A`→`C`) [removing implication]

= ¬((`A`→`B`) ∧ (`B`→`C`))∨
(`A`→`C`) [removing implication, 3 times]

= ¬((¬`A`∨`B`) ∧ (¬`B`∨`C`)) ∨
(¬`A`∨`C`) [DeMorgan]

= (¬(¬`A`∨`B`) ∨ ¬(¬`B`∨`C`)) ∨
(¬`A`∨`C`) [DeMorgan, twice]

= ((¬¬`A`∧¬`B`) ∨ (¬¬`B`∧¬`C`))
∨ (¬`A`∨`C`) [double negation, twice]

= ((`A`∧¬`B`) ∨ (`B`∧¬`C`)) ∨
(¬`A`∨`C`) [associative/commutative laws]

= (`A`∧¬`B`) ∨ ¬`A` ∨
(`B`∧¬`C`) ∨ `C` [distributive law, twice]

= (`A`∨¬`A`)∧(¬`B`∨¬`A`) ∨
(`B`∨`C`) ∧ (¬`C`∨`C`) [law of
excluded middle, twice]

= T ∧ (¬`B`∨¬`A`) ∨ (`B`∨`C`) ∧
T [property of true, twice]

= (¬`B`∨¬`A`) ∨ (`B`∨`C`)
[associative/commutative laws]

= ¬`A` ∨ `B`∨¬`B` ∨ `C` [law of
excluded middle]

= ¬`A` ∨ T ∨ `C` [property of true, twice]

= T ∴

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}}

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|}

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

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

If the formula is correct for |`A`|=`k` (i.e.
|`P`(`A`)|=2^{k}),

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}|`a`∈`P`(`A`)}

=`P`(`A`)∪{{carp}, {cat, carp}, {cow,
carp}, {cat, cow, carp}}

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

General case:

`B` =
{`c`|`c`∈`A`∨`c`=`d`∧`d`∉`A`},

|`B`| = `k`+1 = |`A`|+1,

`P`(`B`)=`P`(`A`)∪{`e`∪{`d`}|`e`∈`P`(`A`)},

|`P`(`B`)|=2·|`P`(`A`)| =
2·2^{k}=2^{k+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`.)

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|B⊂A∧|B|=n}| |
|A| |
n |
|{B|B⊂A∧|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 |

- 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)

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

- even(4): 4 is even
- even(27): 27 is even
- odd(4): 4 is odd
- sunny(November 15, 2019): It is sunny on November 15, 2019
- parent(Ieyasu, Hidetada): Ieyasu is the parent of Hidetada

- smaller(3, 7) (or: 3 < 7)

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

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
- Reading of predicates depends on their meaning

- Operator notation:
- Operators that return true or false are predicates
- Examples: 3 < 7, 5 ≧ 2,
`a`∈`B`, even(`x`) ∨ odd(`y`)

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 have a defined value (true or false)

(e.g. even(`y`) → even(`y`+2), or odd(`z`) →
even(`z`+24))

- The arguments of predicates can be constants, functions (e.g. sin),
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 parent 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 **A**ll", inverted.

Readings in Japanese:

- 全ての自然数
`n`において、`n`が偶数ならば`n`+2 も偶数である - 任意の x において、P(
`x`)

∀`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

- Propositional logic does not need application knowledge except for the truth value of each proposition.
- Predicate logic combines axioms/theorems/knowledge of logic with axioms/theorems/knowledge of one or more application areas.
- Example: Predicate logic on natural numbers: Peano axioms,...
- Example: Predicate logic for sets: Laws for operations on sets,...
- Example: Size of sets: Knowledge about set operations and arithmetic with natural numbers
- Concrete example:
∀

`s`: (male(`s`) ∨ female(`s`)) [all students are either male or female]∀

`s`: ¬(male(`s`) ∧ female(`s`)) [no student is both male and female]

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
**E**xists".

Readings in Japanese:

- P(
`y`) が成立する`y`が存在する - ある
`y`について、P(`y`)

Example: ∀`m`, `n`∈ℕ: `m` > `n`
→ `m`^{2} ≧ `n`^{2}

- ∀: Quantifier
`m`,`n`: Variable(s), separated by commas- ∈ℕ: Set membership (applies to all previous variables connected by commas; unnecessary if there is a single obvious universal set)
- ":": Colon
`m`>`n`→`m`^{2}≧`n`^{2}: Quantified predicate

∀`n`∈ℕ: `n` + `n` + `n` =
3`n`

∃`n`∈ℕ: `n`^{2} =
`n`^{3}

∃`n`∈ℝ: `n`^{2} < 50`n` <
`n`^{3}

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

`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 (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`)

*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`∈`S`: (age(`s`)≤30 ∧ college(`s`)=CSE) ⇔ ∀`u`∈`S`: (age(`u`)≤30 ∧ college(`u`)=CSE)

Using a bound variable outside its scope is an error.

Example: (∀`x`: P(`x`))∧Q(`x`)

(∀`s`∈`S`: age(`s`)≤30) ∧
(∀`t`∈`S`: college(`t`)=CSE) =
∀`u`∈`S`:
(age(`u`)≤30∧college(`u`)=CSE)

is the same as

(∀`s`∈`S`: age(`s`)≤30) ∧ (∀`s`∈`S`: college(`s`)=CSE) = ∀`s`∈`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.

- What is the
*universal set*?

(Example: ∀`i`∈ℕ^{+}:`i`>0) - Notation (colons, parentheses)
- Definition of used predicates
- Free vs. bound variables

- ¬∀
`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

(∃`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.)

- Assume there is a largest prime number
`z`:

∃`z`: prime(`z`) ∧ ∀`y`: prime(`y`) →`y`≤`z` - Calculate a new number as the product of all prime numbers up to
`z`plus 1:

`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`>`z`∧ prime(`y`))

- Predicates are limited because they cannot express complex facts
*Proposition*s are functions or operators that return truth values (true/false)*First order propositional logic*allows formal reasoning for some application domain (e.g. arithmetic, set theory,...)- The
*universal quantifier*(∀) expresses that a predicate is true for*all*members of some set(s) - The
*existential quantifier*(∃) expresses that a predicate is true for some member(s) of some set(s) - Variables not bound by a quantifier are
*free variables*

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

- 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
- 素数