Logic Behind Natural Language Proof
下面使用 ⊢ 表示推出。暂时不做严格定义。
Example 1.
- Assumptions: A is a set, R⊆A×A is a binary relation, …
- Proof step: In order to prove that R is an equivalence relation on A, we prove that k is reflexive on A, symmetric and transitive.
- Logic: If Φ⊢ψ1,Φ⊢ψ2 and Φ⊢ψ3, then Φ⊢ψ1∧ψ2∧ψ3
- Logic (Alternative): (1) ψ1,ψ2,ψ3⊢ψ1∧ψ2∧ψ3 (2) If Φ⊢ψ1,Φ⊢ψ2,Φ⊢ψ3 and ψ1,ψ2,ψ3⊢ψ4, then Φ⊢ψ3
Example 2.
- Assumptions: A is a set, …
- Proof step: Because A is an inductive set, ∅∈A.
- Logic: ϕ∧ψ⊢ϕ
Example 3.
- Proof step: We know that the highest digit of 25012025 is either 1 or not 1.
- Logic: ⊢ϕ∨¬ϕ
Example 4.
- Assumptions: A1, A2, B1 and B2 are sets, …
- Proof step: We apply case analysis on whether B2=∅ for proving (A1→B1)⪯(A2→B2)
- Logic: If Φ,ψ1⊢ψ2, Φ,¬ψ1⊢ψ2, then Φ⊢ψ2
- Logic (Alternative): (1) ⊢ψ∨¬ψ; (2) If Φ,ψ1⊢ψ3, Φ,ψ2⊢ψ3 and Φ⊢ψ1∨ψ2, then Φ⊢ψ3
Syntax of First Order Logic
只是用原子命题和逻辑连接词,表达能力不够。
Example
- Commutative law of addition: for any natural number x and y, x+y=y+x
- 3+5=5+3
这两个命题之间的关系无法由原子命题体现。
Suppose
- P(t1,t2,t3,t4) means (informally) t1+t2=t3+t4
- cthree is a constant symbol representing 3
- cfive is a constant symbol representing 5
Then
- Commutative law of addition: ∀x,∀y,P(x,y,y,x)
- 3+5=5+3: P(cthree,cfive,cfive,cthree)
Example
How to formulate the following sentence in a logic expression?
The cube of cube of 32 is a number ends in 2.
Strategy #1:
- P1(t1,t2): the cube of t1 ends in t2.
- cc: the cube of 32.
- P1(c,ctwo): The cube of cube of 32 is a number ends in 2.
Strategy #2:
- P2(t1,t2): the cube of cube of t1 ends in t2.
- cthirty−two: 32.
- P2(cthirty−two,ctwo): The cube of cube of 32 is a number ends in 2.
在两个不同的 Strategy 中,对于同一个结论:“The cube of cube of 32 is a number ends in 2.”,可以做出两个推论:
- ∃x,P1(x,ctwo)
- ∃x,P2(x,ctwo)
但是想导出这两个推论,有需要对逻辑结构做不同的解读,这说明上面使用的逻辑语言的表达能力还不够。因此不仅要引入谓词符号,还需要引入函数符号。
- P3(t1,t2): t1 ends in t2.
- f(t): the cube of t
- cthirty–two: 32.
- P3(f(cthirty–two),ctwo): The cube of cube of 32 is a number ends in 2.
那么此时就可以说:
- ∃x,P3(f(x),ctwo)
- ∃x,P3(f(f(x)),ctwo)
Definition 5 (FOL Syntax).
- Variables symbols: x,y,z,…
- Constants symbols: c1,c2,…
- Function symbols: f,g,h,…
- Predicate symbols: P,Q,R,…
- Terms (t): x,y,z,…,c1,c2,…,f(t1,t2,…)
- Proposition (ϕ): P(t),Q(t1,t2),ϕ1∧ϕ2,¬ϕ,∃xϕ,∀yψ
Predicate symbols, function symbols and constants forms the symbol set of a first order language.
Example 6 (Quiz).
- If x,y,z,… are varibale symbols, c0,c1,… are constant symbols, f,g,…are function symbols, and P,Q,R,… are predicate symbols, then
- which of the following are first order logic terms?
- x+1,x+y,f(x,y),f(x)+g(y)
- c1+c2,f(g(c1)),h(f(x),g(c2))
- which of the following are first order logic propositions?
- P(x),Q(f(c0)),f(x)<f(x+1),R(x,y)∧R(y,x)
- ∀x∃y(x<y),∀x∀y(R(x,y)∨R(y,x))
Answer: f(x,y),f(g(c1)) and h(f(x),g(c2)); P(x),Q(f(c0)),R(x,y)∧R(y,x) and ∀x∀y(R(x,y)∨(y,x)).
加号不是合法的symbol。
The semantics of first order language
命题逻辑在给定真值指派之后就能得到真值,但是一阶逻辑就更加复杂。比如在使用量词的时候,量词的范围会影响真值。
Definition 7 (S-structures).
Given a symbol set S, an S-structure A=(A,α) contains
- a domain(论域) A, which is a nonempty set
- an interpretation of every predicate symbol, e.g. if P is a symbol of binary predicate, then α(P) is a mapping from A×A→{T,F}
- an interpretation of every function symbol, e.g. if f is a symbol of unary function, then α(f) is a mapping from A→A
- an interpretation of every constant symbol, e.g. if c is a constant symbol, then α(c) is an element in A
上面四条,第一条用 A 指定论域;后面三条用 α 解释一阶逻辑的符号(谓词符号,函数符号,常量符号),有了 α 之后,这些符号的意义才确定下来(就像命题逻辑中,p只是一个符号,只有给定了真值指派之后,真值才确定下来)。S 指的就是一阶逻辑的符号集。
Example 8.
- N is a unary predicate symbol.(一元谓词符号)
- S={N} is a set of symbols.
- ∀x(¬N(x)) is a proposition of the S-language.
- For any a∈R,α(N)(a)=T if a2<0; otherwise α(N)(a)=F.
- A=(R,α) is an S-structure.
- ∀x(¬N(x)) is true on A.
Example 9.
- L is a binary predicate symbol.
- f is a unary function symbol.
- S={L,f} is a set of symbols.
- ∀x(L(x,f(x))) is a proposition of the S-language.
- For any a,b∈Z+,α(L)(a,b)=T if a<b; otherwise α(L)(a,b)=F.
- For any a∈Z+, α(f)(a)=2a
- A=(Z+,α) is an S-structure.
- ∀x(L(x,f(x))) is true on A.