First-Order Logic

Quantifiers

Important

Predicates are propositions with variables

e.g. P(x,y)=x+2=y

When there is a variable, we need to specify the domain

Important

Domain of a variable is the set of all values that may be substituted in place of the variable

Universal and Existential Quantifier

The truth of quantified statement depends on the domain

Translating Mathematical Theorem

If an integer n is greater than 2, then the equation an+bn=cn has no solution in positive integers a,b,c

  1. Find domain: ∀a,b,c∈Z+,(n∈Z)∧(n>2)
  2. Find condition: an+bn≠cn
  3. Convert to p→q format: ∀a,b,c∈Z+.(n∈Z)∧(n>2)→an+bn≠cn
  4. Simplify: ∀a,b,c∈Z+.(n≤2)∨(n∉Z)∨(an+bn≠cn)

Every positive even number at least 6 is a sum of two primes
Suppose given predicates prime(x),even(x)

  1. Find domain: ∀n∈Z+. [even(n)∧(n≥6)]
  2. Find condition: ∃p,q∈Z. prime(p)∧prime(q)∧(p+q=n)
  3. Convert to p→q format: ∀n∈Z+. [even(n)∧(n≥6)]→[∃p,q∈Z. prime(p)∧prime(q)∧(p+q=n)]
  4. Simplify: ∀n∈Z+. odd(n)∨(n<6)∨[∃p,q∈Z. prime(p)∧prime(q)∧(p+q=n)]
∀n∈Z+. [even(n)∧(n≥6)]→[∃p,q∈Z. prime(p)∧prime(q)∧(p+q=n)]≡ ∀n∈Z+. ¬[even(n)∧(n≥6)]∨[∃p,q∈Z. ⋯]≡ ∀n∈Z+. [odd(n)∨(n<6)]∨[∃p,q∈Z. prime(p)∧prime(q)∧(p+q=n)]≡ ∀n∈Z+. odd(n)∨(n<6)∨[∃p,q∈Z. prime(p)∧prime(q)∧(p+q=n)]

Negation

¬∀xP(x)≡∃x¬P(x)

e.g. Not everyone likes football = There exists someone who doesn’t like football.

Proof

Assume the domain is {1,2,3}

¬∀xP(x)=¬(P(1)∧P(2)∧P(3))=¬P(1)∨¬P(2)∨¬P(3)=∃x¬P(x)=R.H.S.
¬∃xP(x)≡∀x¬P(x)

e.g. Not exists a plant that can fly = every plant cannot fly

Multiple Quantifiers

Order of Quantifiers

维度 命题 A (普遍量化优先) 命题 B (存在量化优先)
自然语言 “防病毒软件杀所有计算机病毒”
(Each virus has a killer)
“存在一个杀软能干掉所有病毒”
(One killer kills everything)
逻辑公式 ∀v⋅∃a⋅kills(a,v) ∃a⋅∀v⋅kills(a,v)
约束范围 弱约束。
(∃ 在外层受 ∀ 支配)
只要对当前 v 能找到 a 就行。
强约束。
(∀ 在内层被 ∃ 锁死)
选定后的 a 必须对所有 v 有效。

Hence, order of quantifiers is important.

Arguments of Quantified Statements

Predicate Calculus Validity

Important

A quantified argument is valid if the conclusion is true whenever the assumptions are true

Arguments with Quantified Statements

∀x,P(x)∴P(a)

如果所有 x 都满足 P,那么随便挑一个具体的 a,它当然也满足 P。

∀x,P(x)→Q(x)P(a)∴Q(a)

如果所有 x:P(x)⇒Q(x),而某个 a 满足 P,那么 a 一定满足 Q。

∀x,P(x)→Q(x)¬Q(a)¬P(a)

如果所有 x:P(x)⇒Q(x),而某个 a 不满足 Q,那么 a 一定不满足 P。

Universal Generalization

When c is independent of A,

A→R(c)∴A→∀x.R(x)

If R(c) is true for an arbitrary c, then the statement is true for all values.