# Predicate Logic, Universal and Existential Quantifiers

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

## Discrete Mathematics I

### 6th lecture, Oct. 21, 2016

http://www.sw.it.aoyama.ac.jp/2016/Math1/lecture6.html

# Today's Schedule

• Schedule for the next few weeks
• Summary/homework for last lecture
• Predicates
• Quantifiers
• Laws for Quantifiers
• This week's homework

# Schedule for the Next Few Weeks

• October 21 (today): Predicate Logic, Quantifiers
• October 28: No lectures (Aoyama Festival)
• November 4: No lecture (overseas conference)
• November 11: Next lecture: Application of Predicate Logic

# Summary of Last Lecture

• All Boolean formulæ can be expressed using only NAND (⊼) or only NOR (⊽).
• Logic circuits can be built from gates to implement Boolean functions.
• The main gates are AND, OR, NOT, NAND, NOR, XOR (⊕).
• There are many different ways to axiomatize Boolean logic (learn at least one set of axioms).
• Logical operations important for symbolic logic are implication (→) and equivalence (↔).

# Last Week's Homework: Submission

• A Boolean formula that is always true is called a tautology.
• A Boolean formula that is always false is called a contradiction.
• All laws are tautologies, but there are also tautologies that we don't call laws.
(Example: T→A = ¬¬A)

# 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)
• Predicated 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.

# Examples of Predicates

sunny(today), sunny(tomorrow), sunny(yesterday), even(2), even(5), ...

Generalization: sunny(x), even(y), ...

Using predicates, we can express new things:

• sunny(x) → sunny(day after x)
• even(y) → even(y+2)

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, formulæ,...

Examples:

• even(2), say(Romeo, 'I love you'), father(Ieyasu, Hidetada)
• even(sin(0)), even(2+3×7)
• However, it is not possible to use predicates within predicates
Counterexample: say(z, father(y, x))
(z says "y is the father of x")
• Higher-order logic allows predicates within predicates

# Universal Quantifier

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

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

• 全ての x において、P(x)
• 任意の x において、P(x)

# Existential Quantifier

Example: ∃y∈ℕ: odd (y)

• There is a y, element of ℕ, for which y is odd.
• There is a natural number y so that y is odd.
• There exists a natural number y which is odd.
• There exists an odd natural number.

General form: ∃y: P (y)

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

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

# Example: 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) ∧ (∀a∈ℕ: (P(a)→P(s(a)))) ⇒ ∀a∈ℕ: P(a)

# Laws for Quantifiers

1. ¬∀x: P(x) = ∃x: ¬P(x)
2. ¬∃x: P(x) = ∀x: ¬P(x)
3. (∀x: 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

# This Week's Homework

Deadline: October 27, 2016 (Thursday), 19:00.

Format: A4 single page (using both sides is okay; NO cover page), easily readable handwriting (NO printouts), name (kanji and kana) and student number at the top right

Where to submit: Box in front of room O-529 (building O, 5th floor)

Problem 1: Prove/check the following laws using truth tables:

1. Reductio ad absurdum (A→¬A = ¬A)
2. Contraposition
3. The associative law for disjunction
4. One of De Morgan's laws

Problem 2: Prove transitivity of implication (((AB) ∧ (BC)) ⇒ (AC)) by formula manipulation.
Hint: Show that ((AB) ∧ (BC)) → (AC) is a tautology by simplifying it to T.

For each simplification step, indicate which law you used.

Deadline: November 10, 2016 (Thursday), 19:00.

Format: A4 single page (using both sides is okay; NO cover page; an additional page is okay if really necessary, but staple the pages together at the top left corner), easily readable handwriting (NO printouts), name (kanji and kana) and student number at the top right

Where to submit: Box in front of room O-529 (building O, 5th floor)

Problem 1: Show that the Wolfram axiom of Boolean logic is a tautology (you can use either a truth table or formula manipulation).

Problem 2: For ternary (three-valued) logic, create truth tables for conjunction, disjunction, and negation. The three values are T, F, and ?, where ? stands for "unknown" (in more words: "maybe true, maybe false, we don't know").

Hint: What's the result of "?∨T"? ? can be T or F, but in both cases the result will be T, so ?∨T=T.

Problem 3: For each of the laws 1, 5, 8, 11, and 12 of "Laws for Quantifiers", imagine a concrete example and explain it. For laws 11 and 12, give examples for both why the implication works one way and why the implication does not work the other way.

# Glossary

predicate logic

quantifier

evaluate

evaluation

array

tautology

symbolic logic

multi-valued logic

fuzzy logic
ファジィ論理
ambiguity

first-order predicate logic

temporal logic

binary logic

generalization

undefined

higher-order logic

universal quantifier

existential quantifier