第一章 逻辑与证明
1.1.前言
1.1.1.本章概述
命题、连接词、等价命题、逻辑等价式、命题逻辑、谓词、量词、谓词逻辑、逻辑证明
1.2.命题逻辑(Propositional Logic)
1.2.1.命题及其表示法
具有确定真值的陈述句叫做命题(Proposition) 。 命题有两种类型:不能分解为更简单的陈述语句的称为原子命题(Atomic Proposition) ; 由联结词,标点符号和原子命题复合构成的命题称为复合命题(Compound Proposition) 。 命题常用大写字母或带下标的大写字母或数字表示,如
A
A
A ,
B
i
B_i
B i ,
[
12
]
[12]
[ 1 2 ] 等,这些符号称为命题标识符 。
1.2.2.联结词(Connectives、Logical Operator)
¬
\neg
¬ :否定、非(Negation)
∧
\wedge
∧ 合取、且(Conjunction)
∨
\vee
∨ :析取、或(Disjunction、Inclusive Or)
⊕
\oplus
⊕ :异或(Exclusive Or)
→
\rightarrow
→ :条件语句、蕴含(Implication)
↔
\leftrightarrow
↔ :双向条件语句、双向蕴含(Bi-implication)
Truth Table
P
P
P
Q
Q
Q
¬
P
\neg P
¬ P
P
∧
Q
P \wedge Q
P ∧ Q
P
∨
Q
P \vee Q
P ∨ Q
P
⊕
Q
P\oplus Q
P ⊕ Q
P
→
Q
P \rightarrow Q
P → Q
P
↔
Q
P \leftrightarrow Q
P ↔ Q
T
T
T
T
T
T
F
F
F
T
T
T
T
T
T
F
F
F
T
T
T
T
T
T
T
T
T
F
F
F
F
F
F
F
F
F
T
T
T
T
T
T
F
F
F
F
F
F
F
F
F
T
T
T
T
T
T
F
F
F
T
T
T
T
T
T
T
T
T
F
F
F
F
F
F
F
F
F
T
T
T
F
F
F
F
F
F
F
F
F
T
T
T
T
T
T
条件语句
含义: a necessary condition for p is q a sufficient condition for q is p 衍生: q →p is the converse of p →q — (逆命题) ¬ p → ¬ q is the inverse of p →q (逆否命题) ¬q → ¬ p is the contrapositive of p →q — (否命题)
双条件
含义: p if and only if q p is necessary and sufficient for q if p then q , and conversely p iff q
联结词优先级(Precedence of Logical Operators )
Operator
Precedence
¬
\neg
¬
1
∧
\wedge
∧
2
∨
\vee
∨
3
→
\rightarrow
→
4
↔
\leftrightarrow
↔
5
1.2.3.真值表与等价命题
定义 1 在命题公式中,对于分量指派真值的各种可能组合,就确定了这个命题公式的各种真值情况,把它汇列成表,就是命题公式的真值表 。 n个原子命题,真值表有
2
n
2^n
2 n 行,每个原子命题都有T or F 两种指派。
定义 2 给定两个命题公式
A
A
A 和
B
B
B ,设
P
1
,
P
2
,
⋯
,
P
n
P_1,P_2,\cdots,P_n
P 1 , P 2 , ⋯ , P n 为所有出现于
A
A
A 和
B
B
B 中的原子变元,若给
P
1
,
P
2
,
⋯
,
P
n
P_1,P_2,\cdots,P_n
P 1 , P 2 , ⋯ , P n 任一组真值指派,
A
A
A 和
B
B
B 的真值都相同,则称
A
A
A 和
B
B
B 是等价 的或逻辑相等 的。记作
A
⇔
B
A\Leftrightarrow B
A ⇔ B 。 i.e. 等价命题(Equivalent Propositions) 两个命题是等价的,如果它们始终 具有相同的真值。
所以,如果我们想证明两个命题 (逻辑相等)Equivalence 或者(逻辑不相等)Non-Equivalence ,就可以使用真值表来证明。
1.2.4.逻辑等价式
永真式(Tautologies) 定义 1 - 5.1 给定一命题公式,若无论对分量作怎样的指派,其对应的真值永为
T
\pmb{T}
T T T ,则称该命题公式为重言式 或永真公式 。
永假式(Contradictions) 定义 1 - 5.2 给定一命题公式,若无论对分量作怎样的指派,其对应的真值永为
F
\pmb{F}
F F F ,则称该命题公式为矛盾式 或永假公式 。
定义 1 - 5.3 设
A
A
A 和
B
B
B 为两个命题公式,
A
≡
B
A \equiv B
A ≡ B 当且仅当
A
↔
B
A \leftrightarrow B
A ↔ B 为一个重言式。
定义 1 - 5.4 当且仅当
P
→
Q
P \rightarrow Q
P → Q 是一个重言式时,我们称“
P
P
P 蕴含
Q
Q
Q ”,并记作
P
⇒
Q
P \Rightarrow Q
P ⇒ Q 。
定理 1 - 5.1 任何两个重言式的合取或析取,仍然是一个重言式。
定理 1 - 5.2 设
P
P
P 和
Q
Q
Q 为任意两个命题公式,
P
⇔
Q
P \Leftrightarrow Q
P ⇔ Q 的充分必要条件是
P
⇒
Q
P \Rightarrow Q
P ⇒ Q 且
Q
⇒
P
Q \Rightarrow P
Q ⇒ P 。
Key Logical Equivalences
命题定律
表达式
对合律 Double Negation Law
¬
¬
P
≡
P
\neg\neg P \equiv P
¬ ¬ P ≡ P
幂等律 Idempotent laws
P
∨
P
≡
P
,
P
∧
P
≡
P
P \vee P \equiv P , P \wedge P \equiv P
P ∨ P ≡ P , P ∧ P ≡ P
结合律 Associative Laws
(
P
∨
Q
)
∨
R
≡
P
∨
(
Q
∨
R
)
(
P
∧
Q
)
∧
R
≡
P
∧
(
Q
∧
R
)
\begin{aligned}(P \vee Q)\vee R \equiv P \vee (Q \vee R)\\(P \wedge Q)\wedge R \equiv P \wedge (Q \wedge R)\end{aligned}
( P ∨ Q ) ∨ R ≡ P ∨ ( Q ∨ R ) ( P ∧ Q ) ∧ R ≡ P ∧ ( Q ∧ R )
交换律 Commutative Laws
P
∨
Q
≡
Q
∨
P
P
∧
Q
≡
Q
∧
P
\begin{aligned}P \vee Q \equiv Q \vee P\\P \wedge Q \equiv Q \wedge P\end{aligned}
P ∨ Q ≡ Q ∨ P P ∧ Q ≡ Q ∧ P
分配律 Distributive Laws
P
∨
(
Q
∧
R
)
≡
(
P
∨
Q
)
∧
(
P
∨
R
)
P
∧
(
Q
∨
R
)
≡
(
P
∧
Q
)
∨
(
P
∧
R
)
\begin{aligned}P \vee (Q \wedge R) \equiv (P \vee Q)\wedge(P \vee R)\\P \wedge (Q \vee R) \equiv (P \wedge Q)\vee(P \wedge R)\end{aligned}
P ∨ ( Q ∧ R ) ≡ ( P ∨ Q ) ∧ ( P ∨ R ) P ∧ ( Q ∨ R ) ≡ ( P ∧ Q ) ∨ ( P ∧ R )
吸收律 Absorption Laws
P
∨
(
P
∧
Q
)
≡
P
P
∧
(
P
∨
Q
)
≡
P
\begin{aligned}P \vee (P \wedge Q) \equiv P\\P \wedge (P \vee Q) \equiv P\end{aligned}
P ∨ ( P ∧ Q ) ≡ P P ∧ ( P ∨ Q ) ≡ P
德·摩根律 DeMorgan’s Law
¬
(
P
∨
Q
)
≡
¬
P
∧
¬
Q
¬
(
P
∧
Q
)
≡
¬
P
∨
¬
Q
\begin{aligned}\neg(P \vee Q) \ \equiv \neg P \wedge \neg Q\\\neg(P \wedge Q) \ \equiv \neg P \vee \neg Q\end{aligned}
¬ ( P ∨ Q ) ≡ ¬ P ∧ ¬ Q ¬ ( P ∧ Q ) ≡ ¬ P ∨ ¬ Q
同一律 Identity Laws
P
∨
F
≡
P
,
P
∧
T
≡
P
P \vee \pmb{F} \equiv P , P \wedge \pmb{T} \equiv P
P ∨ F F F ≡ P , P ∧ T T T ≡ P
零律 Domination Laws
P
∨
T
≡
T
,
P
∧
F
≡
F
P \vee \pmb{T} \equiv \pmb{T} , P \wedge \pmb{F} \equiv \pmb{F}
P ∨ T T T ≡ T T T , P ∧ F F F ≡ F F F
否定律 Negation Laws
P
∨
¬
P
≡
T
,
P
∧
¬
P
≡
F
P \vee \neg P \equiv \pmb{T} , P \wedge \neg P \equiv \pmb{F}
P ∨ ¬ P ≡ T T T , P ∧ ¬ P ≡ F F F
More key Logical Equivalences
P
→
Q
≡
¬
P
∨
Q
P \rightarrow Q\equiv \neg P \vee Q
P → Q ≡ ¬ P ∨ Q
¬
(
P
→
Q
)
≡
P
∧
¬
Q
\neg(P \rightarrow Q) \equiv P \wedge \neg Q
¬ ( P → Q ) ≡ P ∧ ¬ Q
P
↔
Q
≡
(
P
→
Q
)
∧
(
Q
→
P
)
P \leftrightarrow Q \equiv(P \rightarrow Q) \wedge(Q \rightarrow P)
P ↔ Q ≡ ( P → Q ) ∧ ( Q → P )
P
↔
Q
≡
(
P
∧
Q
)
∨
(
¬
P
∧
¬
Q
)
P \leftrightarrow Q \equiv(P \wedge Q) \vee(\neg P \wedge \neg Q)
P ↔ Q ≡ ( P ∧ Q ) ∨ ( ¬ P ∧ ¬ Q )
1.3.谓词逻辑
1.3.1.谓词的概念与表示
我们用大写字母表示谓词 ,用小写字母表示客体名称 ,如
A
(
b
)
A(b)
A ( b ) 、
B
(
a
,
b
)
B(a,b)
B ( a , b ) 、
L
(
a
,
b
,
c
)
L(a,b,c)
L ( a , b , c ) 等,表示客体是否具有谓词所表述的那个性质 。 单独一个谓词不是完整的命题(谓词没有真假值),我们把谓词字母后填以客体所得的式子称为谓词填式 ,如果
A
A
A 为
n
n
n 元谓词,
a
1
,
a
2
,
⋯
,
a
n
a_1,a_2,\cdots,a_n
a 1 , a 2 , ⋯ , a n 是客体的名称,则
A
(
a
1
,
a
2
,
⋯
,
a
n
)
A(a_1,a_2,\cdots,a_n)
A ( a 1 , a 2 , ⋯ , a n ) 就可成为命题 。
Predicate can be viewed as propositional functions. i.e. P(x) is a propositional function of variable x
1.3.2.命题函数(Propositional Function)与量词(Quantifiers)
引入两种量词(Quantifiers) , 一个用符号
(
∀
x
)
(\forall x)
( ∀ x ) 表示,代表“对所有的
x
x
x ”,称为全称量词(Universal Quantifiers) ; 另一个用符号
(
∃
x
)
(\exist x)
( ∃ x ) 表示,表示“存在一些
x
x
x ”,称为存在量词(Existential Quantifiers) 。全称量词和存在量词通称为量词。
量词的优先级: 量词的优先级最高
1.3.3.变元的约束
给定
α
\alpha
α 为一个谓词公式,其中有一部分公式形式为
(
∀
x
)
P
(
x
)
(\forall x)P(x)
( ∀ x ) P ( x ) 或
(
∃
x
)
P
(
x
)
(\exist x)P(x)
( ∃ x ) P ( x ) 。这里
∀
\forall
∀ 和
∃
\exist
∃ 后面所跟的
x
x
x 叫做量词的指导变元 或作用变元 ,
P
(
x
)
P(x)
P ( x ) 叫做相应量词的作用域 或辖域 。在作用域中
x
x
x 的一切出现,称为
x
x
x 在
α
\alpha
α 中的约束出现 ,
x
x
x 也称为被相应量词中的指导变元所约束 。在
α
\alpha
α 中除去约束变元以外所出现的变元称作自由变元 。自由变元可看作是公式中的参数 。
设
P
(
x
1
,
x
2
,
⋯
,
x
n
)
P(x_1,x_2,\cdots,x_n)
P ( x 1 , x 2 , ⋯ , x n ) 是
n
n
n 元谓词,它有
n
n
n 个相互独立的自由变元,若对其中
k
k
k 个变元进行约束,则成为
n
−
k
n-k
n − k 元谓词。例如,
(
∀
x
)
P
(
x
,
y
,
z
)
(\forall x)P(x,y,z)
( ∀ x ) P ( x , y , z ) 是二元谓词,
(
∃
y
)
(
∀
x
)
P
(
x
,
y
,
z
)
(\exist y)(\forall x)P(x,y,z)
( ∃ y ) ( ∀ x ) P ( x , y , z ) 是一元谓词。
约束变元的改名 一个公式的约束变元所使用的名称符号是无关紧要的,
(
∃
x
)
P
(
x
)
(\exist x)P(x)
( ∃ x ) P ( x ) 和
(
∃
y
)
P
(
y
)
(\exist y)P(y)
( ∃ y ) P ( y ) 意义相同。因此,我们可以对公式
α
\alpha
α 中的约束变元更改名称符号,这种遵守一定规则的更改,称为约束变元的换名 。其规则为: (1)对于约束变元可以换名,其更改的变元名称范围是量词中的指导变元 ,以及该量词作用域中所出现的该变元,在公式的其余部分不变 。 (2)换名时一定要更改为作用域中没有出现的变元名称。 举例来说,公式
(
∀
x
)
(
P
(
x
)
→
R
(
x
,
y
)
)
∧
Q
(
x
,
y
)
(\forall x)(P(x)\rightarrow R(x,y))\wedge Q(x,y)
( ∀ x ) ( P ( x ) → R ( x , y ) ) ∧ Q ( x , y ) 可换名为
(
∀
z
)
(
P
(
z
)
→
R
(
z
,
y
)
)
∧
Q
(
x
,
y
)
(\forall z)(P(z)\rightarrow R(z,y)) \wedge Q(x,y)
( ∀ z ) ( P ( z ) → R ( z , y ) ) ∧ Q ( x , y )
变元的绑定 ①变元被赋予某个特定值 ②变元被量词约束
1.3.4.谓词演算的等价式与蕴含式
命题公式的推广 命题演算中的等价公式表和蕴含式表都可推广到谓词演算中使用。例如
(
∀
x
)
(
P
(
x
)
→
Q
(
x
)
)
⇔
(
∀
x
)
(
¬
P
(
x
)
∨
Q
(
x
)
)
(
(
∀
x
)
P
(
x
)
)
∨
(
∃
y
)
R
(
x
,
y
)
⇔
¬
(
¬
(
∀
x
)
P
(
x
)
∧
¬
(
∃
y
)
R
(
x
,
y
)
)
(\forall x)(P(x)\rightarrow Q(x))\Leftrightarrow(\forall x)(\neg P(x)\vee Q(x)) \\ ((\forall x)P(x))\vee(\exist y)R(x,y) \Leftrightarrow \neg(\neg(\forall x)P(x)\wedge \neg (\exist y)R(x,y))
( ∀ x ) ( P ( x ) → Q ( x ) ) ⇔ ( ∀ x ) ( ¬ P ( x ) ∨ Q ( x ) ) ( ( ∀ x ) P ( x ) ) ∨ ( ∃ y ) R ( x , y ) ⇔ ¬ ( ¬ ( ∀ x ) P ( x ) ∧ ¬ ( ∃ y ) R ( x , y ) )
量词与联结词
¬
\neg
¬ 之间的关系 (De Morgan’s Laws for Quantifiers)
¬
(
∀
x
)
P
(
x
)
⇔
(
∃
x
)
¬
P
(
x
)
\neg(\forall x)P(x)\Leftrightarrow (\exist x)\neg P(x)
¬ ( ∀ x ) P ( x ) ⇔ ( ∃ x ) ¬ P ( x )
¬
(
∃
x
)
P
(
x
)
⇔
(
∀
x
)
¬
P
(
x
)
\neg(\exist x)P(x)\Leftrightarrow(\forall x)\neg P(x)
¬ ( ∃ x ) P ( x ) ⇔ ( ∀ x ) ¬ P ( x )
量词的作用域中如果含有合取项或析取项,则当其中一项为命题时,可将该命题移至量词作用域之外,比如
(
∀
x
)
(
A
(
x
)
∨
B
)
⇔
(
∀
x
)
A
(
x
)
∨
B
(\forall x)(A(x)\vee B) \Leftrightarrow (\forall x)A(x)\vee B
( ∀ x ) ( A ( x ) ∨ B ) ⇔ ( ∀ x ) A ( x ) ∨ B 因为在
B
B
B 中不出现约束变元
x
x
x 。
类似的式子还有
(
(
∀
x
)
A
(
x
)
→
B
)
⇔
(
∃
x
)
(
A
(
x
)
→
B
)
(
(
∃
x
)
A
(
x
)
→
B
)
⇔
(
∀
x
)
(
A
(
x
)
→
B
)
(
B
→
(
∀
x
)
A
(
x
)
)
⇔
(
∀
x
)
(
B
→
A
(
x
)
)
(
B
→
(
∃
x
)
A
(
x
)
)
⇔
(
∃
x
)
(
B
→
A
(
x
)
)
((\forall x)A(x)\rightarrow B)\Leftrightarrow(\exist x)(A(x)\rightarrow B) \\ ((\exist x)A(x)\rightarrow B)\Leftrightarrow(\forall x)(A(x)\rightarrow B) \\ (B\rightarrow(\forall x)A(x))\Leftrightarrow(\forall x)(B\rightarrow A(x)) \\ (B\rightarrow(\exist x)A(x))\Leftrightarrow(\exist x)(B\rightarrow A(x))
( ( ∀ x ) A ( x ) → B ) ⇔ ( ∃ x ) ( A ( x ) → B ) ( ( ∃ x ) A ( x ) → B ) ⇔ ( ∀ x ) ( A ( x ) → B ) ( B → ( ∀ x ) A ( x ) ) ⇔ ( ∀ x ) ( B → A ( x ) ) ( B → ( ∃ x ) A ( x ) ) ⇔ ( ∃ x ) ( B → A ( x ) )
量词与命题联结词之间的一些等价式
(
∀
x
)
(
A
(
x
)
∧
B
(
x
)
)
⇔
(
∀
x
)
A
(
x
)
∧
(
∀
x
)
B
(
x
)
(
∃
x
)
(
A
(
x
)
∨
B
(
x
)
)
⇔
(
∃
x
)
A
(
x
)
∨
(
∃
x
)
B
(
x
)
(\forall x)(A(x)\wedge B(x))\Leftrightarrow(\forall x)A(x)\wedge(\forall x)B(x) \\ (\exist x)(A(x)\vee B(x))\Leftrightarrow(\exist x)A(x)\vee(\exist x)B(x)
( ∀ x ) ( A ( x ) ∧ B ( x ) ) ⇔ ( ∀ x ) A ( x ) ∧ ( ∀ x ) B ( x ) ( ∃ x ) ( A ( x ) ∨ B ( x ) ) ⇔ ( ∃ x ) A ( x ) ∨ ( ∃ x ) B ( x )
量词与命题联结词之间的一些蕴含式
(
∀
x
)
A
(
x
)
∨
(
∀
x
)
B
(
x
)
⇒
(
∀
x
)
(
A
(
x
)
∨
B
(
x
)
)
(
∃
x
)
(
A
(
x
)
∧
B
(
x
)
)
⇒
(
∃
x
)
A
(
x
)
∧
(
∃
x
)
B
(
x
)
(
∀
x
)
(
A
(
x
)
→
B
(
x
)
)
⇒
(
∀
x
)
A
(
x
)
→
(
∀
x
)
B
(
x
)
(
∀
x
)
(
A
(
x
)
⇆
B
(
x
)
)
⇒
(
∀
x
)
A
(
x
)
⇆
(
∀
x
)
B
(
x
)
(\forall x)A(x)\vee(\forall x)B(x)\Rightarrow(\forall x)(A(x)\vee B(x)) \\ (\exist x)(A(x)\wedge B(x))\Rightarrow(\exist x)A(x)\wedge(\exist x)B(x) \\ (\forall x)(A(x)\rightarrow B(x))\Rightarrow(\forall x)A(x)\rightarrow(\forall x)B(x) \\ (\forall x)(A(x)\leftrightarrows B(x))\Rightarrow(\forall x)A(x)\leftrightarrows(\forall x)B(x)
( ∀ x ) A ( x ) ∨ ( ∀ x ) B ( x ) ⇒ ( ∀ x ) ( A ( x ) ∨ B ( x ) ) ( ∃ x ) ( A ( x ) ∧ B ( x ) ) ⇒ ( ∃ x ) A ( x ) ∧ ( ∃ x ) B ( x ) ( ∀ x ) ( A ( x ) → B ( x ) ) ⇒ ( ∀ x ) A ( x ) → ( ∀ x ) B ( x ) ( ∀ x ) ( A ( x ) ⇆ B ( x ) ) ⇒ ( ∀ x ) A ( x ) ⇆ ( ∀ x ) B ( x )
嵌套量词
(
∀
x
)
(
∀
y
)
A
(
x
,
y
)
⇔
(
∀
y
)
(
∀
x
)
A
(
x
,
y
)
(
∃
x
)
(
∃
y
)
A
(
x
,
y
)
⇔
(
∃
y
)
(
∃
x
)
A
(
x
,
y
)
(
∀
x
)
(
∀
y
)
A
(
x
,
y
)
⇒
(
∃
y
)
(
∀
x
)
A
(
x
,
y
)
⇒
(
∀
x
)
(
∃
y
)
A
(
x
,
y
)
⇒
(
∃
x
)
(
∃
y
)
A
(
x
,
y
)
(\forall x)(\forall y)A(x,y) \Leftrightarrow (\forall y)(\forall x)A(x,y) \\ (\exist x)(\exist y)A(x,y) \Leftrightarrow (\exist y)(\exist x)A(x,y) \\ \begin{aligned}(\forall x)(\forall y)A(x,y)&\Rightarrow (\exist y)(\forall x)A(x,y) \\ &\Rightarrow(\forall x)(\exist y)A(x,y)\\&\Rightarrow(\exist x)(\exist y)A(x,y)\end{aligned}
( ∀ x ) ( ∀ y ) A ( x , y ) ⇔ ( ∀ y ) ( ∀ x ) A ( x , y ) ( ∃ x ) ( ∃ y ) A ( x , y ) ⇔ ( ∃ y ) ( ∃ x ) A ( x , y ) ( ∀ x ) ( ∀ y ) A ( x , y ) ⇒ ( ∃ y ) ( ∀ x ) A ( x , y ) ⇒ ( ∀ x ) ( ∃ y ) A ( x , y ) ⇒ ( ∃ x ) ( ∃ y ) A ( x , y )
1.3.5.前束范式(拓展内容)
定义 2 - 6.1 一个公式,如果量词均在全式的开头,它们的作用域,延申到整个公式的末尾,则该公式叫做前束范式 。
定理 2 - 6.1 任意一个谓词公式,均和一个前束范式等价。
例题1 化公式
(
∀
x
)
(
∀
y
)
(
(
∃
z
)
(
P
(
x
,
z
)
∧
P
(
y
,
z
)
)
→
(
∃
u
)
Q
(
x
,
y
,
u
)
)
(\forall x)(\forall y)((\exist z)(P(x,z)\wedge P(y,z))\rightarrow(\exist u)Q(x,y,u))
( ∀ x ) ( ∀ y ) ( ( ∃ z ) ( P ( x , z ) ∧ P ( y , z ) ) → ( ∃ u ) Q ( x , y , u ) ) 为前束范式。 解:否定深入
原
式
⇔
(
∀
x
)
(
∀
y
)
(
¬
(
∃
z
)
(
P
(
x
,
z
)
∧
P
(
y
,
z
)
)
∨
(
∃
u
)
Q
(
x
,
y
,
u
)
)
⇔
(
∀
x
)
(
∀
y
)
(
∀
z
)
(
∃
u
)
(
¬
P
(
x
,
z
)
∨
¬
P
(
y
,
z
)
∨
Q
(
x
,
y
,
u
)
)
\begin{aligned}原式&\Leftrightarrow(\forall x)(\forall y)(\neg(\exist z)(P(x,z)\wedge P(y,z))\vee(\exist u)Q(x,y,u))\\&\Leftrightarrow(\forall x)(\forall y)(\forall z)(\exist u)(\neg P(x,z)\vee\neg P(y,z)\vee Q(x,y,u))\end{aligned}
原 式 ⇔ ( ∀ x ) ( ∀ y ) ( ¬ ( ∃ z ) ( P ( x , z ) ∧ P ( y , z ) ) ∨ ( ∃ u ) Q ( x , y , u ) ) ⇔ ( ∀ x ) ( ∀ y ) ( ∀ z ) ( ∃ u ) ( ¬ P ( x , z ) ∨ ¬ P ( y , z ) ∨ Q ( x , y , u ) )
例题2 化
wff
D
\text{wff }D
wff D :
(
∀
x
)
[
(
∀
y
)
P
(
x
)
∨
(
∀
z
)
q
(
z
,
y
)
→
¬
(
∀
y
)
R
(
x
,
y
)
]
(\forall x)\left[(\forall y)P(x)\vee(\forall z)q(z,y)\rightarrow\neg(\forall y)R(x,y)\right]
( ∀ x ) [ ( ∀ y ) P ( x ) ∨ ( ∀ z ) q ( z , y ) → ¬ ( ∀ y ) R ( x , y ) ] 为前束合取范式。 解:取消多余量词→换名→消去条件联结词→否定深入→量词推到最左边
D
⇔
(
∀
x
)
[
P
(
x
)
∨
(
∀
z
)
q
(
z
,
y
)
→
¬
(
∀
y
)
R
(
x
,
y
)
]
⇔
(
∀
x
)
[
P
(
x
)
∨
(
∀
z
)
q
(
z
,
y
)
→
¬
(
∀
w
)
R
(
x
,
w
)
]
⇔
(
∀
x
)
{
¬
[
P
(
x
)
∨
(
∀
z
)
q
(
z
,
y
)
]
∨
¬
(
∀
w
)
R
(
x
,
w
)
}
⇔
(
∀
x
)
[
¬
P
(
x
)
∧
(
∃
z
)
¬
q
(
z
,
y
)
∨
(
∃
w
)
¬
R
(
x
,
w
)
]
⇔
(
∀
x
)
(
∃
z
)
(
∃
w
)
[
(
¬
P
(
x
)
∨
¬
R
(
x
,
w
)
)
∧
(
¬
q
(
z
,
y
)
∨
¬
R
(
x
,
w
)
)
]
\begin{aligned}D&\Leftrightarrow(\forall x)\left[P(x)\vee(\forall z)q(z,y)\rightarrow\neg(\forall y)R(x,y)\right]\\&\Leftrightarrow(\forall x)\left[P(x)\vee(\forall z)q(z,y)\rightarrow\neg(\forall w)R(x,w)\right]\\&\Leftrightarrow(\forall x)\left\{\neg [P(x)\vee(\forall z)q(z,y)]\vee\neg(\forall w)R(x,w)\right\}\\&\Leftrightarrow(\forall x)[\neg P(x)\wedge(\exist z)\neg q(z,y)\vee(\exist w)\neg R(x,w)]\\&\Leftrightarrow(\forall x)(\exist z)(\exist w)[(\neg P(x)\vee\neg R(x,w))\wedge(\neg q(z,y)\vee\neg R(x,w))]\end{aligned}
D ⇔ ( ∀ x ) [ P ( x ) ∨ ( ∀ z ) q ( z , y ) → ¬ ( ∀ y ) R ( x , y ) ] ⇔ ( ∀ x ) [ P ( x ) ∨ ( ∀ z ) q ( z , y ) → ¬ ( ∀ w ) R ( x , w ) ] ⇔ ( ∀ x ) { ¬ [ P ( x ) ∨ ( ∀ z ) q ( z , y ) ] ∨ ¬ ( ∀ w ) R ( x , w ) } ⇔ ( ∀ x ) [ ¬ P ( x ) ∧ ( ∃ z ) ¬ q ( z , y ) ∨ ( ∃ w ) ¬ R ( x , w ) ] ⇔ ( ∀ x ) ( ∃ z ) ( ∃ w ) [ ( ¬ P ( x ) ∨ ¬ R ( x , w ) ) ∧ ( ¬ q ( z , y ) ∨ ¬ R ( x , w ) ) ]
1.4.推理规则(Rules of Inference)
1.4.1.有效论证(Valid Arguments)
命题逻辑中的论证是由一串命题 (
r
1
、
r
2
、
…
…
r
n
、
s
r_1、r_2、……r_n、s
r 1 、 r 2 、 … … r n 、 s )构成。 如果称这个论证是有效的,也就得满足,如果前提全为真,则结果也为真。 (An argument in propositional logic is a sequence of propositions. )
i
f
(
s
1
∧
s
2
…
…
∧
s
n
)
=
t
r
u
e
,
t
h
e
n
c
=
t
r
u
e
.
if\quad (s_1\wedge s_2……\wedge s_n)=true,then\quad c=true.
i f ( s 1 ∧ s 2 … … ∧ s n ) = t r u e , t h e n c = t r u e . i.e.
(
s
1
∧
s
2
…
…
∧
s
n
)
→
c
≡
T
(s_1\wedge s_2……\wedge s_n)\rightarrow c \equiv T
( s 1 ∧ s 2 … … ∧ s n ) → c ≡ T
更一般地,如果用有效的论证(Valid Arguments 从一串premise(
s
1
、
s
2
、
…
…
s
n
s_1、s_2、……s_n
s 1 、 s 2 、 … … s n )推导出新的一串premise(
S
1
、
S
2
…
…
S
m
S_1、S_2……S_m
S 1 、 S 2 … … S m )。 论证(
S
1
、
S
2
…
…
S
n
、
C
S_1、S_2……S_n、C
S 1 、 S 2 … … S n 、 C )也是有效地,因为
(
S
1
∧
S
2
…
…
∧
S
n
)
→
C
≡
T
(S_1\wedge S_2……\wedge S_n)\rightarrow C \equiv T
( S 1 ∧ S 2 … … ∧ S n ) → C ≡ T 。
1.4.2.命题逻辑中的有效论证(Valid Arguments in Propositional Logic)
1.4.3.谓词演算的推理理论(Rules of Inference for Quantified Statement)
(1)全称指定规则,即
U
S
US
U S 规则(全称量词消去律)。
(
∀
x
)
P
(
x
)
∴
P
(
c
)
\frac{(\forall x)P(x)}{\therefore\ P(c)}
∴ P ( c ) ( ∀ x ) P ( x ) (2)全称推广规则 ,即
U
G
UG
U G 规则(全称量词引入律)。
P
(
c
)
f
o
r
a
n
a
r
b
i
t
r
a
r
y
c
∴
(
∀
x
)
P
(
x
)
\frac{P(c)\ for\ an \ arbitrary\ c}{\therefore\quad (\forall x)P(x)}
∴ ( ∀ x ) P ( x ) P ( c ) f o r a n a r b i t r a r y c (3)存在指定规则,即
E
S
ES
E S 规则(全称量词消去律)。
(
∃
x
)
P
(
x
)
∴
P
(
c
)
f
o
r
s
o
m
e
e
l
e
m
e
n
t
c
\frac{(\exist x)P(x)}{\therefore\quad P(c)\ for\ some\ element\ c}
∴ P ( c ) f o r s o m e e l e m e n t c ( ∃ x ) P ( x ) (4)存在推广规则 ,即
E
G
EG
E G 规则(存在量词引入律)。
P
(
c
)
f
o
r
s
o
m
e
e
l
e
m
e
n
t
c
∴
(
∃
x
)
P
(
x
)
\frac{P(c)\ for \ some \ \ element \ c }{\therefore\quad (\exist x)P(x)}
∴ ( ∃ x ) P ( x ) P ( c ) f o r s o m e e l e m e n t c