Chapter 3 Tutorials

T1

用等值演算、构造指派等方式判断公式的永真性

(1)判断永真性:

\((\forall xP(x)\rightarrow \exist xQ(x))\rightarrow\exist x (P(x)\rightarrow Q(x) )\)

首先尝试转化前束范式

\[\begin{aligned} & (\forall xP(x)\rightarrow \exist xQ(x)) \rightarrow\exist x (P(x)\rightarrow Q(x) )\\ \Leftrightarrow & \neg (\neg \forall x P(x) \lor \exist x Q(x)) \lor \exist x(\neg P(x)\lor Q(x) )\\ \Leftrightarrow & (\forall x P(x) \land \neg \exist x Q(x)) \lor \exist x(\neg P(x)\lor Q(x))\\ \Leftrightarrow & (\forall x P(x) \land \forall x \neg Q(x)) \lor \exist x(\neg P(x)\lor Q(x))\\ \Leftrightarrow & \forall x (P(x)\land \neg Q(x)) \lor \exist x(\neg P(x)\lor Q(x)) & (*) \end{aligned} \]

  • “到这一步已经显然了”,因为\((*)\)式左右两边互为另一边的否定。可知,原式是永真式。

讨论公式在任意指派\(\sigma\)下的真值,若\(\sigma(\forall x(P(x)\land \neg Q(x))=0\),则\(\sigma(\exist x(\neg P(x)\lor Q(x))=1\),故原式在\(\sigma\)下为真,因而是永真式。

(2)判断永真性:

\((\forall x P(x)\rightarrow \forall x Q(x))\rightarrow \forall x (P(x)\rightarrow Q(x))\)

尝试转化前束范式

\[\begin{aligned} & (\forall x P(x)\rightarrow \forall x Q(x)) \rightarrow \forall x (P(x)\rightarrow Q(x))\\ \Leftrightarrow & \neg(\neg \forall xP(x)\lor \forall xQ(x)) \lor \forall x (\neg P(x)\lor Q(x))\\ \Leftrightarrow & (\forall x P(x) \land \exist x \neg Q(x)) \lor \forall x (\neg P(x)\lor Q(x)) & (*) \end{aligned} \]

看起来不太乐观,考虑证明原式可以为假。尝试构造反例:

  1. 考虑\((*)\)式右半边,知\(P^I(x)\)不能是永假式、\(Q^I(x)\)不能是永真式,且存在一个\(x\)的赋值令\(\neg P^I(x)\)\(Q^I(x)\)均为假

  2. 考虑\((*)\)式左半边。既然\(Q^I(x)\)不是永真式,那么\(\exist x \neg Q^I(x)\)为真。因此\(\forall x P^I(x)\)为假,所以\(P^I(x)\)不是永真式

  3. 既然\(Q^I(x)\)不能是永真式,保险起见,不妨令\(Q^I(x)\)永假。这同时也满足了1.中「不能同时为真」的条件。然后再令\(P^I(x)\)有时为真有时为假就好了

\(D=\{0,1\}, P^I(x)=x, Q^I(x)\equiv 0\),此时原式为假,因此原式不是永真式。

T2

以下哪一步出现错误?

\[\begin{aligned} & \forall x(G(x)\lor H(x))\\ \models & \neg\neg\forall x(G(x)\lor H(x)) & 1\\ \models & \neg\exists x\neg(G(x)\lor H(x)) & 2\\ \models & \neg\exists x(\neg G(x)\land\neg H(x)) & 3\\ \models & \neg(\exists x\neg G(x)\land \exists x\neg H(x)) & 4\\ \models & \neg\exists x\neg G(x) \lor \neg\exists x\neg H(x) & 5\\ \models & \forall x G(x)\lor \forall x H(x) & 6 \end{aligned} \]

A: 3 B: 4 C: 5 D: 6 E: 没有错误

答案是B。首先,选「没有错」的同学不妨检验一下原式能否推出\((6)\)

\((4)\)错在哪呢?注意到如下两件事:

\[\begin{aligned} \exists x(G(x) \land H(x) ) &\models \exists x G(x) \land \exists x H(x)\\ \neg P \rightarrow \neg Q &\models Q \rightarrow P \end{aligned} \]

其中,第二条是中学时常用的逆否律。将两者组合可知,\((4)\)方向反了。

这件事启发我们:量词与联结词之间没有任何运算性质,没有结合律,没有交换律也没有分配律。所以处理这种问题的最安全办法就是先按照已知结论将公式化为前束式,然后再做其他操作。

T3

前束范式\(A\)的无\(\forall\)前束范式\(A'\)的递归定义如下

  1. \(A\)不含\(\forall\)量词,则\(A'\)是$ A$

  2. \(A\)\(\forall y B\),则\(A'\)\((B^y_a)'\),其中\(a\)\(B\)所不包含的常元

  3. \(A\)\(\exists x_1\exists x_2\cdots \exists x_n\forall yB\),则\(A'\)\(\left(\exists x_1\exists x_2\cdots \exists x_nB^y_{f(x_1,x_2,\cdots x_n)}\right)'\),其中\(f\)\(B\)所不包含的函词

证明前束范式\(A\)是永真式当且仅当\(A'\)是永真式,其中,\(A'\)\(A\)的无\(\forall\)前束范式

解析

此题要双向证明,若A永真则A'永真比较显然,以下说明A'永真则A永真的证明过程:
归纳证明:

  1. 若A为无\(\forall\)前束范式,则A'是A,结论成立。

  2. 若A是\(\forall yB\),则A'是\((B^y_a)'\)。由归纳假设知\((B^y_a)'\)为永真式可推得\(B^y_a\)为永真式,这意味着对于所有解释和赋值\(I,\sigma\),有\(I(B^y_a)(\sigma) = 1\),特别地,取I对a的指派为论域\(D_I\)中所有元素,即有对于\(\forall d \in D_I\)都有\(I(B)(\sigma[y/I(a)]) = I(B)(\sigma[y/d]) = 1\),即\(I(\forall yB)(\sigma) = 1\)。由\(I\)\(\sigma\)的任意性可知\(\forall yB\)为永真式。即由\(B^y_a\)永真可推得\(\forall yB\)永真,由传递性知\((B^y_a)'\)永真可推得\(\forall yB\)永真,即A'永真可推得A永真。

  3. 若A是\(\exist x_1 \exist x_2 \cdots \exist x_n \forall yB\), 则A'是\((\exist x_1 \exist x_2 \cdots \exist x_n B^y_{f(x_1,x_2,\cdots,x_n)})'\),由归纳假设知\(A'\)是永真式则\(\exist x_1 \exist x_2 \cdots \exist x_n B^y_{f(x_1,x_2,\cdots,x_n)}\)是永真式。

    我们说明存在一组\(x_i\)的指派\(\sigma\),使得不论\(f(x_1^\sigma,x_2^\sigma,\cdots,x_n^\sigma)\)取何值,均有\(\sigma\left(B^y_{f(x_1,x_2\cdots,x_n)}\right)=1\)

    假设不存在这样的指派,则对于任意指派\(\sigma\),总存在\(f(x_1,x_2,\cdots,x_n)\)的取值\(c^\sigma\),使得\(\sigma\left(B^y_{c^\sigma}\right)=0\),因此存在\(f\)的解释\(I:I(f(x_1,x_2,\cdots,x_n))(\sigma)=c^\sigma\),使得\(\forall \sigma,I\left(B^y_{f(x_1,x_2,\cdots,x_n)}\right)(\sigma)=0\),与\(A'\)永真相矛盾。

    由上述结论中\(f(\textbf{x}^\sigma)\)取值的任意性知,\(\forall y B[x_i/x_i^\sigma]\)是永真式,因而\(A=\exist x_1 \exist x_2 \cdots \exist x_n \forall y B\)是永真式。

注意事项

证明时所有步骤都应该对\(a\)\(f\)的指派说明,而非对\(y\)说明

T4

判断对错:在谓词逻辑中,永真式一定是重言式 (❌)

在命题逻辑中,「永真式」与「有效式」、「重言式」是同一概念。在谓词逻辑中,「永真式」和「有效式」是同一概念,含义是「公式在任何指派下的真值都是1」;但它们跟「重言式」不是同一概念,「重言式」是它们的真子集。

「重言式」在概念上要求公式不仅是有效式,而且「指派仅由联结词性质确定(定义3.1.4)」即「\(\sigma(Q)\)的取值仅由\(Q\)中的联结词的性质确定」,或者说「删掉\(Q\)中的量词,\(Q\)依然是永真式」。

显然T2中的公式就是一个属于永真式,但不属于重言式的例子,这说明重言式是永真式的真子集。

判断对错:如果谓词公式\(Q\)是有效式,并且指派仅由联结词性质确定,则\(Q\)也称为重言式(✅)

见定义\(3.1.4\)

T5

证明\(\forall x\forall x P(x)\Leftrightarrow \forall x P(x)\)

Proof

其实这道题正确率很高,但由于我给的答案给得过于简略以致于我自己都没看懂,所以重新详细地证一遍

\((\Rightarrow)\)

由定义\(3.1.1\)知,若\(\sigma(\forall x\forall xP(x))=1\),则\(\sigma\Big(\big(\forall x P(x)\big)[x/d]\Big)=1\),因为\(x\)不是自由变元所以\(\big(\forall x P(x)\big)[x/d]\)就是\(\forall x P(x)\),所以\(\sigma(\forall x P(x))=1\)。因此\(\forall x\forall x P(x)\models \forall x P(x)\)

\((\Leftarrow)\)

由定理\(3.2.11\),若\(\Gamma \models Q\),且\(x\)不是\(\Gamma\)中任意公式的自由变元,则\(\Gamma\models\forall x Q\)

\(Q=\forall x P(x),\Gamma = \{Q\}\),由于\(Q\models Q\),故\(Q\models \forall x Q\),即\(\forall x P(x) \models \forall x \forall x P(x)\)

T6

用指派函数方法判断合式公式的真值

\(\exist x \forall y Q(x,y) \rightarrow \forall y\exist xQ(x,y)\)

这显然是一个闭公式,它的语义只跟\(Q\)的解释有关,首先任取指派\(\sigma\)

\[\begin{aligned} & \sigma(\exist x \forall y Q(x,y) \rightarrow \forall y\exist xQ(x,y))\\ =&\sigma(\exist x \forall y Q^\sigma(x,y) \rightarrow \forall y\exist xQ^\sigma(x,y))\\ =&\exist x \forall y Q^\sigma(x,y) \rightarrow \forall y\exist xQ^\sigma(x,y) \end{aligned} \]

  1. \(\exist x \forall y Q^\sigma(x,y)=0\),则原式在指派\(\sigma\)下为真

  2. \(\exist x \forall y Q^\sigma(x,y)=1\),则存在常元\(a\),使得\(\forall y Q^\sigma(a,y)\)为真,因而\(\forall y \exist x Q^\sigma(x,y)\)也为真,于是原式为真

    • 反过来则不行,因为\(\forall y \exist x Q^\sigma(x,y)=1\)只能得到存在\(f\),使得\(\forall y Q^\sigma(f(y), y)\)成立

综上可知,原式为永真式

  • 注意要判断「合式公式的真值」,而不是合式公式「在某一指派下的真值」

T7

下面的谓词逻辑公式中,哪个是前束范式?

\[\forall x \forall y \exists z (B(x,y) \rightarrow A(z)) \tag{1.1} \]

前束范式对开公式中的联结词没有要求,故\((1.1)\)式是前束范式。

\[\exists x \forall y \forall x (A(x,y)\land B(x,y) ) \tag{1.2} \]

前束范式要求每个量词后的变元必须不同,故\((1.2)\)式不是前束范式。

T8

给定解释\(I\)如下:

\[D_I=\{a,b\}; P^I(a,a)=P^I(b,b)=1, P^I(a,b)=P^I(b,a)=0 \]

求公式

  1. \(\exists x\forall y P(x,y)\)

  2. \(\forall y\exists x P(x,y)\)

在解释\(I\)下的真值

1假,2真

PS:让我看看是哪些小可爱搁那\(\forall x \exists y P(x,y) \Rightarrow \exists y \forall x P(x,y)\) !?

T9

证明\(\exists y\forall x(P(x)\rightarrow Q(y))\)既不是永真式也不是永假式

让我看看又是哪些小可爱搁那证明里面的开公式不是永真也不是永假???

量词也是公式的一部分。所以这道题的正确做法是对每个公式给出两个论域和对应的解释\(<D_1,I_1>,<D_2,I_2>\),分别使「包括量词在内的整个公式」为真/假。

T10

\(\exists x F(x) \rightarrow (\neg\forall y G(x,y)\land \exists z H(z) )\)变为前束范式

注意\(\exists x F(x)\)中的\(x\)\(G(x,y)\)中的\(x\)不是同一个\(x\)

另外还有少部分同学弄错\(\exists x\)的辖域,而将\(\rightarrow\)转化为\(\neg ... \lor ...\)时把\(\neg\)放错了位置。

当然,还有另一小部分小可爱觉得\(\rightarrow\)可以直接来回挪动,这是非常错误和危险的

T11

判断等值式是否成立,并说明理由

  1. \(\forall x P(x) \Leftrightarrow P(x)\)
  2. \(\forall x\forall x P(x) \Leftrightarrow \forall x P(x)\)
  3. \(\forall x (P(x) \leftrightarrow \forall y Q(y)) \Leftrightarrow \forall x P(x) \leftrightarrow \forall y Q(y)\)

  1. 取论域\(\mathbb D=\{a,b\}\),解释\(I\)满足\(P^I(a)=1, P^I(b)=0\),指派\(\sigma(x/a)\)\(0\Leftrightarrow \forall x P^I(x) \not\Leftrightarrow P^I(x^\sigma)\Leftrightarrow 1\)

    这一问的问题在于,某些同学错误地从第2问获得启发,认为两者是一样的。实际上,闭公式跟开公式还是很不一样的

  2. 第2问是成立的。一方面\(\forall x (\forall x P(x)) \models (\forall x P(x))\);另一方面,\(\forall x P(x) \models \forall x P(x)\)\(x\)不是自由变元,故\(\forall x P(x) \models \forall x (\forall x P(x))\)

  3. 注意左边括号内部的公式为\(P(x)\leftrightarrow \forall y Q(y)\),显然\(P(x)\)可以有多种取值,而\(\forall y Q(y)\)只有一个取值。取指派函数,使得\(Q^\sigma(y)\Leftrightarrow 0, P^\sigma(a)=0, P^\sigma(b)=1\)。此时,由于\(P^\sigma(x)\not\Leftrightarrow 0\),左式真值为假;由于\(\forall x P(x) \Leftrightarrow 0\),右式真值为真,构成一个等值式的反例。

T12

根据题目中给出的解释写出下列公式的含义,并判断真值

论域为整数集合\(\mathbb Z\),指派\(\sigma\)如下:

\[a^\sigma=2, f^\sigma(x,y)=x*y, g^\sigma(x,y)=x+y, F^\sigma(x,y)=(x=y) \]

写出下列公式的数学语言含义并判断逻辑语义:

\[\begin{aligned} 1) & \forall xF(f(x, a), x)\\ 2) & \forall x\forall y (F(f(x,a), y)\rightarrow F(f(y, a), x))\\ 3) & \forall x\forall y\exists zF(f(x, y), z)\\ 4) & \exists x\forall y\forall zF(f(y,z),x)\\ 5) & \exists x F(f(x,x), g(x,x)) \end{aligned} \]

注意事项:

按照解释的定义一步一步来,细心一些不要看错抄错。

不少同学仍然认为(3)(4)是等价的,然而,事实上量词出现顺序对公式的真值有非常大的影响。如果不理解这一点,可以参考作业3-1解析中关于 幽夜默示录 第二幕的部分。

T13

将公式化为前束范式

2:∃z∀y(F(z)∨G(x,y))

2:∃z∀u¬(F(z,y)∨G(x,u))

3:\(\forall x \forall y \exists z \forall u \exists v (P(x,y,z) \land (\neg Q(x,u) \lor Q(y,v) )\)

4:\(\exists x \forall x_2 \exists x_3 (\neg(F(x)\rightarrow G(x) )\lor \neg F(x_2) \lor G(x_3) )\)

5:∀x∀y∀z∃u(¬(P(x,z)∧P(y,z))∨Q(x,y,u))

6:\(\forall x \exists y_2 \exists x_2 (\neg P(x) \lor \neg Q(y) \lor (R(y_2) \land \neg S(x_2) ) )\)

注意事项:

  1. 先把\(\oplus\)\(\leftrightarrow\)还有\(\rightarrow\)替换掉。特别是\(\rightarrow\),其中隐含一个加在前件上的\(\neg\),如果不提前处理很容易引发错误

  2. 运用量词变换等值公式:
    \(\neg \forall xQ(x) \Leftrightarrow \exist x\neg Q(x)\)
    \(\neg \exist xQ(x) \Leftrightarrow \forall x\neg Q(x)\)

  3. 运用 换名等值公式 和以下公式从里到外逐渐将所有量词前提:
    \(R\land \forall xQ(x) \Leftrightarrow \forall x(R\land Q(x))\)

    其中将\(\exist\)\(\forall\)互换,将\(\land\)\(\lor\)互换仍成立,同时如果是\(\rightarrow\)的话如果Q(x)在前面则同时需要将\(\exist\)\(\forall\)互换,在后面则不用。(R中的自由变元没有x)。

以第一题举例:

\[\begin{aligned} &原式\\ \Leftrightarrow & \forall x\neg F(x)\rightarrow \forall yG(x,y)\\ \Leftrightarrow & \forall z\neg F(z)\rightarrow \forall yG(x,y)\\ \Leftrightarrow & \exist z(\neg F(z)\rightarrow \forall yG(x,y))\\ \Leftrightarrow & \exist z\forall y(\neg F(z)\rightarrow G(x,y)) \end{aligned} \]

T14

\((\forall x P(x) \lor \exist y Q(y) ) \rightarrow \exist z R(z)\)的前束范式

\[\begin{aligned} & (\forall x P(x) \lor \exist y Q(y) ) \rightarrow \exist z R(z)\\ \Leftrightarrow & \neg (\forall x P(x) \lor \exist y Q(y) ) \lor \exist z R(z)\\ \Leftrightarrow & \neg \forall x P(x) \land \neg \exist y Q(y) \lor \exist z R(z)\\ \Leftrightarrow & \exist x \neg P(x) \land \forall y \neg Q(y) \lor \exist z R(z)\\ \Leftrightarrow & \exist x \neg P(x) \land \forall y \neg Q(y) \lor \exist z R(z)\\ \Leftrightarrow & \exist x \forall y \exist z \Big(\neg P(x) \land \neg Q(y) \lor R(z)\Big)\\ \end{aligned} \]

先转化\(\rightarrow\),然后用De'Morgan律将\(\neg\)下沉,最后将量词提前

  1. 注意不要直接提取\(\rightarrow\)前面的量词,这常常造成错误

  2. 注意最后一步需要加括号

\(\exist x (P(x)\rightarrow \forall y Q(x,y))\lor\exist z R(z)\)的斯科伦范式

\[\begin{aligned} & \exist x (P(x)\rightarrow \forall y Q(x,y))\lor\exist z R(z)\\ \Leftrightarrow & \exist x \forall y (\neg P(x) \lor Q(x,y))\lor \exist z R(z) & (1)\\ \Leftrightarrow & \exist z \exist x \forall y (\neg P(x) \lor Q(x,y)\lor R(z)) & (2)\\ \end{aligned} \]

  1. 看清\(\exist x\)的辖域,有一小部分同学因为这个出错了

  2. 为了省掉不必要的函词,可以先把\(\exist z\)提到前面

\[\text{斯科伦范式为:}\forall y (\neg P(a)\lor Q(a,y)\lor R(b)) \]

\(\forall y\exist x\exist z\forall u\exist v P(x,y,z,u,v)\)的斯科伦范式

这道题因为题面出错而直接送掉了,不过这道题倒是很好地展示了函词应当如何插入

  1. 注意三个函词的名称应该是不同的

  2. 注意\(x,z\)对应的函词是\(y\)的函数,而\(v\)对应的函词应该是\(y,u\)的函数

\[\forall y \forall u P\Big(f_x(y), y, f_z(y), u, f_v(y,u) \Big) \]

T15

求下列公式的斯科伦范式

\[\begin{aligned} 1)& \neg \forall x(P(x)\rightarrow \forall y(P(y)\rightarrow P(f(x,y))) \land\neg \forall y(Q(x,y)\rightarrow P(y)))\\ 2)& \forall x\exists y(P(x,y)\rightarrow Q(y,x)) \land(Q(y,x)\rightarrow R(x,y))\\ 3)& \forall x P(x,y)\rightarrow(Q(x)\rightarrow \neg R(y,x))\\ 4)& \forall xP(x,y)\oplus \exists yQ(x,y) \end{aligned} \]

注意事项

首先变成前束范式,具体步骤在T2中已给出,再按照给定的步骤转换成无存在前束范式

斯科伦范式要求母式为合取范式

注意不要用等价符号连接原式和斯科伦范式,斯科伦范式仅在某些情况下与原式等价。具体的,原式为永假式当且仅当斯科伦范式为永假式

1

\[\Leftrightarrow \exists x \exists y_1 \forall y_2 \bigg( P(x) \land \Big( \big( P(y_1) \land \neg P(f(x,y_1)) \big) \lor \neg Q(x,y_2) \lor P(y_2) \Big) \bigg) \]

skolen form

\[\forall z \bigg( P(a) \land \Big( \big( P(b) \land \neg P(f(a,b)) \big) \lor \neg Q(a,z) \lor P(z) \Big) \bigg) \Leftrightarrow\\ \forall z \bigg( P(a) \land \Big( \big( P(b) \lor \neg Q(a,z) \lor P(z) \big) \land \big(\neg P(f(a,b)) \lor \neg Q(a,z) \lor P(z) \big) \Big) \bigg) \]

2

skolen form

\[\Leftrightarrow \forall z \bigg( \Big( P(z, f(z)) \rightarrow Q(f(z), z) \Big) \land \Big(Q(b,a) \rightarrow R(a,b)\Big) \bigg) \Leftrightarrow\\ \forall z \bigg( \Big( \neg P(z, f(z)) \lor Q(f(z), z) \Big) \land \Big( \neg Q(b,a) \lor R(a,b)\Big) \bigg) \]

3

\[\Leftrightarrow \exists x \neg P(x,y) \lor \neg Q(x) \lor \forall x \neg R(y,x)\\ \Leftrightarrow \exists x_1\forall x_2 \big( \neg P(x_1,y) \lor \neg Q(x) \lor \neg R(y,x_2) \big)\\ \Leftrightarrow \forall x_2\exists x_1 \big( \neg P(x_1,y) \lor \neg Q(x) \lor \neg R(y,x_2) \big) \]

skolen form

\[\forall z \big( \neg P(a,y) \lor \neg Q(x) \lor \neg R(y,z) \big)\\ \forall z \big( \neg P(f(z),y) \lor \neg Q(x) \lor \neg R(y,z) \big) \]

4

先按照\(\oplus\)的定义转化

\[\Leftrightarrow \Big( \forall x_1 P(x_1,y) \land \forall y_1 \neg Q(x,y_1) \Big)\lor \Big( \exists x_2 \neg P(x_2,y) \land \exists y_2 Q(x,y_2) \Big)\\ \Leftrightarrow \forall x_1 \forall y_1 \exists x_2 \exists y_2 \Big( \big( P(x_1,y) \land \neg Q(x,y_1) \big)\lor \big( \neg P(x_2,y) \land Q(x,y_2) \big)\Big) \]

skolen form

\[\begin{aligned} &\forall z \forall w \Big( \big( P(z,y) \land \neg Q(x,w) \big)\lor \big( \neg P(a,y) \land Q(x,b) \big)\Big) \\ \Leftrightarrow& \forall z \forall w \Big( \big( P(z,y) \lor \big( \neg P(a,y) \land Q(x,b) \big) \big) \\ &\qquad \land \big(\neg Q(x,w) \lor \big( \neg P(a,y) \land Q(x,b) \big) \big) \Big) \\ \Leftrightarrow& \forall z \forall w \Big( (P(z,y) \lor \neg P(a,y)) \land (P(z,y) \lor Q(x,b) ) \\ &\quad \land (\neg Q(x,w) \lor \neg P(a,y)) \land (\neg Q(x,w) \lor Q(x,b)) \Big) \end{aligned} \]

这道题一开始就用合取范式消去\(\oplus\)会省掉不少麻烦,最后得到的斯科伦范式如下:

\[\forall z \forall w ((P(z,y)\lor Q(x,a)) \land ( \neg P(b,y) \lor \neg Q(x,w)) ) \]

posted @ 2024-05-03 10:46  fallqs  阅读(186)  评论(0编辑  收藏  举报