Logic Behind Natural Language Proof

下面使用 \vdash 表示推出。暂时不做严格定义。

Example 1.

  • Assumptions: AA is a set, RA×AR \subseteq A\times A is a binary relation, …
  • Proof step: In order to prove that RR is an equivalence relation on AA, we prove that kk is reflexive on AA, symmetric and transitive.
  • Logic: If Φψ1,Φψ2\Phi \vdash \psi_1, \Phi \vdash \psi_2 and Φψ3\Phi \vdash \psi_3, then Φψ1ψ2ψ3\Phi \vdash \psi_1 \land \psi_2 \land \psi_3
  • Logic (Alternative): (1) ψ1,ψ2,ψ3ψ1ψ2ψ3\psi_1, \psi_2, \psi_3 \vdash \psi_1 \land \psi_2 \land \psi_3 (2) If Φψ1,Φψ2,Φψ3\Phi \vdash \psi_1, \Phi \vdash \psi_2, \Phi \vdash \psi_3 and ψ1,ψ2,ψ3ψ4\psi_1, \psi_2, \psi_3 \vdash \psi_4, then Φψ3\Phi \vdash \psi_3

Example 2.

  • Assumptions: AA is a set, …
  • Proof step: Because AA is an inductive set, A\varnothing \in A.
  • Logic: ϕψϕ\phi \land \psi \vdash \phi

Example 3.

  • Proof step: We know that the highest digit of 250120252501^{2025} is either 11 or not 11.
  • Logic: ϕ¬ϕ\vdash \phi \lor \lnot \phi

Example 4.

  • Assumptions: A1, A2, B1 and B2 are sets, …
  • Proof step: We apply case analysis on whether B2=B_2 = \varnothing for proving (A1B1)(A2B2)(A_1 \to B_1) \preceq (A_2 \to B_2)
  • Logic: If Φ,ψ1ψ2\Phi, \psi_1 \vdash \psi_2, Φ,¬ψ1ψ2\Phi, \lnot \psi_1 \vdash \psi_2, then Φψ2\Phi \vdash \psi_2
  • Logic (Alternative): (1) ψ¬ψ\vdash \psi \lor \lnot \psi; (2) If Φ,ψ1ψ3\Phi, \psi_1 \vdash \psi_3, Φ,ψ2ψ3\Phi, \psi_2 \vdash \psi_3 and Φψ1ψ2\Phi \vdash \psi_1 \lor \psi_2, then Φψ3\Phi \vdash \psi_3

Syntax of First Order Logic

只是用原子命题和逻辑连接词,表达能力不够。

Example

  • Commutative law of addition: for any natural number xx and yy, x+y=y+xx+y = y+x
  • 3+5=5+33+5 = 5+3

这两个命题之间的关系无法由原子命题体现。

Suppose

  • P(t1,t2,t3,t4)P(t_1, t_2, t_3, t_4) means (informally) t1+t2=t3+t4t_1+t_2 = t_3+t_4
  • cthreec_{\text{three}} is a constant symbol representing 33
  • cfivec_{\text{five}} is a constant symbol representing 55

Then

  • Commutative law of addition: x,y,P(x,y,y,x)\forall x, \forall y, P(x, y, y, x)
  • 3+5=5+33+5 = 5+3: P(cthree,cfive,cfive,cthree)P(c_{\text{three}}, c_{\text{five}}, c_{\text{five}}, c_{\text{three}})

Example
How to formulate the following sentence in a logic expression?
The cube of cube of 3232 is a number ends in 22.

Strategy #1:

  • P1(t1,t2)P_1(t_1,t_2): the cube of t1t_1 ends in t2t_2.
  • ccc_c: the cube of 3232.
  • P1(c,ctwo)P_1(c,c_{two}): The cube of cube of 3232 is a number ends in 22.

Strategy #2:

  • P2(t1,t2)P_2(t_1,t_2): the cube of cube of t1t_1 ends in t2t_2.
  • cthirtytwoc_{thirty-two}: 3232.
  • P2(cthirtytwo,ctwo)P_2(c_{thirty-two},c_{two}): The cube of cube of 3232 is a number ends in 22.

在两个不同的 Strategy 中,对于同一个结论:“The cube of cube of 3232 is a number ends in 22.”,可以做出两个推论:

  • x,P1(x,ctwo)\exists x, P_1(x, c_{\text{two}})
  • x,P2(x,ctwo)\exists x, P_2(x, c_{\text{two}})

但是想导出这两个推论,有需要对逻辑结构做不同的解读,这说明上面使用的逻辑语言的表达能力还不够。因此不仅要引入谓词符号,还需要引入函数符号。

  • P3(t1,t2)P_3(t_1,t_2): t1t_1 ends in t2t_2.
  • f(t)f(t): the cube of tt
  • cthirty–twoc_{\text{thirty--two}}: 3232.
  • P3(f(cthirty–two),ctwo)P_3(f(c_{\text{thirty--two}}),c_{\text{two}}): The cube of cube of 3232 is a number ends in 22.

那么此时就可以说:

  • x,P3(f(x),ctwo)\exists x, P_3(f(x),c_\text{two})
  • x,P3(f(f(x)),ctwo)\exists x, P_3(f(f(x)), c_\text{two})

Definition 5 (FOL Syntax).

  • Variables symbols: x,y,z,x, y, z, \ldots
  • Constants symbols: c1,c2,c_1, c_2, \ldots
  • Function symbols: f,g,h,f, g, h, \ldots
  • Predicate symbols: P,Q,R,P, Q, R, \ldots
  • Terms (tt): x,y,z,,c1,c2,,f(t1,t2,)x, y, z, \ldots , c_1, c_2, \ldots ,f(t_1, t_2, \ldots )
  • Proposition (ϕ\phi): P(t),Q(t1,t2),ϕ1ϕ2,¬ϕ,xϕ,yψP(t), Q(t_1, t_2), \phi_1 \land \phi_2, \lnot \phi, \exists x\phi, \forall y \psi

Predicate symbols, function symbols and constants forms the symbol set of a first order language.

Example 6 (Quiz).

  • If x,y,z,x, y, z, \ldots are varibale symbols, c0,c1,c_0, c_1, \ldots are constant symbols, f,g,f, g, \ldotsare function symbols, and P,Q,R,P, Q, R, \ldots are predicate symbols, then
  • which of the following are first order logic terms?
    • x+1,x+y,f(x,y),f(x)+g(y)x + 1, x + y, f(x, y), f(x) + g(y)
    • c1+c2,f(g(c1)),h(f(x),g(c2))c_1 + c_2, f(g(c_1)), h(f(x), g(c_2))
  • 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)P(x), Q(f(c_0)), f(x) < f(x + 1), R(x, y) \land R(y, x)
    • xy(x<y),xy(R(x,y)R(y,x))\forall x \exists y (x < y), \forall x\forall y (R(x, y) \lor R(y, x))

Answer: f(x,y),f(g(c1))f(x, y), f(g(c_1)) and h(f(x),g(c2))h(f(x), g(c_2)); P(x),Q(f(c0)),R(x,y)R(y,x)P(x), Q(f(c_0)), R(x, y)\land R(y, x) and xy(R(x,y)(y,x))\forall x\forall y (R(x, y) \lor (y, x)).
加号不是合法的symbol。

The semantics of first order language

命题逻辑在给定真值指派之后就能得到真值,但是一阶逻辑就更加复杂。比如在使用量词的时候,量词的范围会影响真值。

Definition 7 (SS-structures).
Given a symbol set SS, an SS-structure A=(A,α)\mathcal{A} = (A, \alpha) contains

  • a domain(论域) AA, which is a nonempty set
  • an interpretation of every predicate symbol, e.g. if PP is a symbol of binary predicate, then α(P)\alpha(P) is a mapping from A×A{T,F}A\times A \to \{ T, F \}
  • an interpretation of every function symbol, e.g. if ff is a symbol of unary function, then α(f)\alpha(f) is a mapping from AAA \to A
  • an interpretation of every constant symbol, e.g. if cc is a constant symbol, then α(c)\alpha(c) is an element in AA

上面四条,第一条用 AA 指定论域;后面三条用 α\alpha 解释一阶逻辑的符号(谓词符号,函数符号,常量符号),有了 α\alpha 之后,这些符号的意义才确定下来(就像命题逻辑中,pp只是一个符号,只有给定了真值指派之后,真值才确定下来)。SS 指的就是一阶逻辑的符号集。

Example 8.

  • NN is a unary predicate symbol.(一元谓词符号)
  • S={N}S = \{ N \} is a set of symbols.
  • x(¬N(x))\forall x (\lnot N(x)) is a proposition of the SS-language.
  • For any aR,α(N)(a)=Ta \in \mathbb{R}, \alpha(N)(a) = T if a2<0a^{2}<0; otherwise α(N)(a)=F\alpha(N)(a) = F.
  • A=(R,α)\mathcal{A} = (R, \alpha) is an SS-structure.
  • x(¬N(x))\forall x (\lnot N(x)) is true on A\mathcal{A}.

Example 9.

  • LL is a binary predicate symbol.
  • ff is a unary function symbol.
  • S={L,f}S = \{ L, f \} is a set of symbols.
  • x(L(x,f(x)))\forall x(L(x, f(x))) is a proposition of the SS-language.
  • For any a,bZ+,α(L)(a,b)=Ta, b \in \mathbb{Z}^{+}, \alpha(L)(a, b) = T if a<ba<b; otherwise α(L)(a,b)=F\alpha(L)(a, b) = F.
  • For any aZ+a\in \mathbb{Z}^{+}, α(f)(a)=2a\alpha(f)(a) = 2a
  • A=(Z+,α)\mathcal{A} = (\mathbb{Z}^{+}, \alpha) is an SS-structure.
  • x(L(x,f(x)))\forall x(L(x, f(x))) is true on A\mathcal{A}.