Super detailed explanation of propositional logic


Propositional logic mainly studies the logical relationship between premises and conclusions

proposition

definition

An assertion (declarative sentence) that is true or false but not both is called a proposition. Commonly used capital letters A, B, C, ⋯ A,B,C,\cdots
A,B,C, represents a proposition, such as propositionPPP : It will rain tomorrow.
If the judgment expressed by a proposition is true, its truth value is "true", represented by the capital letter T or the number 1.
If the judgment expressed by a proposition is false, its truth value is " False", represented by a capital letter F or the number 0

It can be seen from the definition that the proposition needs to meet the following conditions:

  • declarative sentences expressing judgment
  • Has a definite true or false value

Classification

According to the traditional and simplified version of the proposition

simple proposition

A proposition that does not contain other simpler propositions is called a simple proposition

For example, the proposition "Diaoyu Islands belong to China" is a simple proposition, and it does not contain any simpler proposition.

compound proposition

Propositions that are composed of simple propositions and connectives are called compound propositions

For example: the proposition "If it doesn't rain tomorrow, then I will go for a picnic" is a compound proposition, because it is a combination of the proposition "It won't rain tomorrow" and the proposition "I will go for a picnic"

Propositional Constants and Propositional Variables

A symbol that represents a definite proposition is called a propositional constant , usually expressed as TT according to its truth value.T orFFF represents; asymbol that can generally refer to any propositionis calleda proposition variable, also calleda proposition variable or a sentence variable, usually with capital lettersA, B, C, ⋯ A,B,C,\cdotsA,B,C, means that
propositional constants can be analogized to constants in the field of real numbers, such asπ \piπ ; Propositional variables can be analogized to variables in the real number domain, such asxxThe value of the argument of x
proposition is eitherTTT is eitherFFF , that is, the set of propositional constants; just like the variablexxThe value of x is the same as the numbers in the real number field, which is the set of all real constants.

Obviously, a propositional variable is not a proposition because its truth value is indeterminate (it can only be known using a specific proposition)

connective word

In algebra, use + , − , × , ÷ +,-,\times,\div+,,×,Operators such as ÷ connect numbers to obtain algebraic expressions, such as57 + 1226 57+122657+1226
In mathematical logic, there are also operators, calledlogical connectives, orconnectives
. Therefore, connectives are essentiallyoperators of mathematical logic.

In Chinese, commonly used connectives include "not", "and", "or", "if... then...", "if and only if", etc. There are also some in mathematical logic
. the corresponding connectives

mathematical connectives The corresponding words in Chinese Symbol Example
negative connective No ¬ \lnot ¬ ¬ P \lnot P ¬P
conjunctive connective And
and
and
∧ \land P ∧ Q P\land Q PQ
disjunctive connective or ∨ \lor P ∨ Q P\lor Q PQ
conditional connective If..., then...
as long as...
→ \rightarrow P → Q P\rightarrow Q PQ
biconditional connective if and only if ↔ \leftrightarrow P ↔ Q P\leftrightarrow Q PQ

Priority: ¬ \lnot¬Highest priority,∧ , ∨ \land,\lor, followed by→ , ↔ \rightarrow,\leftrightarrow,↔The lowest priority; connectives with the same priority are ordered from left to right

Types of connectives

negative connective

P P P is a proposition, then “notPP”P ” is a compound proposition, denoted as¬ P \lnot P¬ Pwhere
:¬ \lnot¬The symbol fornegativeconnectives

¬ P \lnot P ¬ P is true if and only ifPPP is false

Here is the truth table for negative connectives :

P PP ¬ P \lnot P¬P
0 1
1 0
conjunctive connective

P , Q P,Q P,Q is a proposition, then “PPP andQQQ ” is a compound proposition, denoted asP ∧ QP\land QPQwhere
:∧ \land∧The symbolrepresentingconjunctive connectives

P ∧ Q P\land Q PQ is true if and only ifP, QP,QP,Q is all true

Here is the truth table for conjunctive connectives :

P P P Q Q Q P ∧ Q P\land QPQ
0 0 0
0 1 0
1 0 0
1 1 1
disjunctive connective

P , Q P,Q P,Q is a proposition, then “PPP orQQQ ” is a compound proposition, denoted asP ∨ QP\lor QPQwhere
:∨ \lor∨The symbolrepresentinga disjunctive connective

P ∨ Q P\lor Q PQ is true if and only ifP, QP,QP,At least one of Q is true

Here is the truth table for the disjunctive connective :

P PP Q QQ P ∨ Q P\lor QPQ
0 0 0
0 1 1
1 0 1
1 1 1
conditional connective

P , Q P,QP,Q is a proposition, then “ifPPP thenQQQ ” is a compound proposition, denoted asP → QP\rightarrow QPQwhere
:→ \rightarrow The symbolrepresentingthe conditional connective
is called:

  • P P P isthe hypothesisorantecedent
  • Q Q Q isthe conclusionorconsequent

P → Q P\rightarrow Q PQ is false if and only ifPPP istrueQQQ is false

Here is the truth table for conditional connectives :

P PP Q QQ P → Q P\rightarrow QPQ
0 0 1
0 1 1
1 0 0
1 1 1

P → Q ⇔ ¬ P ∨ Q P\rightarrow Q\Leftrightarrow\lnot P\lor Q PQ¬PQwhere⇔
\Leftrightarrow is the equivalent symbol, seeEquivalence

Why is it so defined? The following example explains in detail:
If I say: "If it doesn't rain tomorrow, then I will go hiking" I
might as well set PPP : It won’t rain tomorrow,QQQ : I'm going to climb a mountain,P → QP\rightarrow QPQ : If it doesn’t rain tomorrow, then I will go hiking.
If the actual situation is: it won’t rain tomorrow (PPP is1 11 ), and I went hiking (QQQ is1 11 ), we know that what I said is true (P → QP\rightarrow QPQ is1 11 )
If the actual situation is: it won’t rain tomorrow (PPP is1 11 ), but I didn’t go hiking (QQQ is0 00 ), it can be seen that what I said is false (P → QP\rightarrow QPQ is0 00 )
The above two situations are easy to understand.
If the actual situation is: it will rain tomorrow (PPP is0 00 ), then regardless of whether I went hiking or not, you cannot say that what I said is false, nor can you say it is true. Because none of the assumptions are met
, and the explanation in the book "Discrete Mathematics, Xi'an University of Electronic Science and Technology Press, Second Edition" is "well-intentioned regulations", that is, PPP is0 00 , we all think thatP → QP\rightarrow QPQ is1 11

biconditional connective

P , Q P,Q P,Q is a proposition, then “PPP if and only ifQQQ ” is a compound proposition, denoted asP ↔ QP\leftrightarrow QPQWhere
:↔ \leftrightarrow↔symbol representingbiconditionalconnectives

P ↔ Q P\leftrightarrow Q PQ is true if and only ifP, QP,QP,The truth values ​​of Q are the same

Here is the truth table for the biconditional connective :

P P P Q Q Q P ↔ Q P\leftrightarrow QPQ
0 0 1
0 1 0
1 0 0
1 1 1

P ↔ Q ⇔ ( P → Q ) ∧ ( Q → P ) P\leftrightarrow Q\Leftrightarrow(P\rightarrow Q)\land(Q\rightarrow P) PQ(PQ)(QP)

conditional negative connective

↛ \nrightarrow 表示条件否定联结词的符号

P ↛ Q P\nrightarrow Q PQ 为真,当且仅当 P P P 为真 Q Q Q 为假

下面是条件否定联结词的真值表

P P P Q Q Q P ↛ Q P\nrightarrow Q PQ
0 0 0
0 1 0
1 0 1
1 1 0

P ↛ Q ⇔ ¬ ( P → Q ) P\nrightarrow Q\Leftrightarrow \lnot(P\rightarrow Q) PQ¬(PQ)

异或联结词

⊕ \oplus 表示异或联结词的符号

P ⊕ Q P\oplus Q PQ 为真,当且仅当 P , Q P,Q P,Q 真值不同

下面是异或联结词的真值表

P P P Q Q Q P ⊕ Q P\oplus Q PQ
0 0 0
0 1 1
1 0 1
1 1 0

P ⊕ Q ⇔ ¬ ( P ↔ Q ) P\oplus Q\Leftrightarrow\lnot(P\leftrightarrow Q) PQ¬(PQ)

或非联结词

↓ \downarrow 表示或非联结词的符号

P ↓ Q P\downarrow Q PQ 为真,当且仅当 P , Q P,Q P,Q 都为假

下面是或非联结词的真值表

P P P Q Q Q P ↓ Q P\downarrow Q PQ
0 0 1
0 1 0
1 0 0
1 1 0

P ↓ Q ⇔ ¬ ( P ∨ Q ) P\downarrow Q\Leftrightarrow\lnot(P\lor Q) PQ¬(PQ)

与非联结词

↑ \uparrow 表示与非联结词的符号

P ↑ Q P\uparrow Q PQ 为假,当且仅当 P , Q P,Q P,Q 都为真

下面是与非联结词的真值表

P P P Q Q Q P ↑ Q P\uparrow Q PQ
0 0 1
0 1 1
1 0 1
1 1 0

P ↑ Q ⇔ ¬ ( P ∧ Q ) P\uparrow Q\Leftrightarrow\lnot(P\land Q) PQ¬(PQ)

联结词的完备集

下面证明以上 9 个联结词能表达所有命题
命题可以符号化为命题公式,而由命题公式的递归定义的条款 2 可知命题公式只包含一元和二元运算符

  1. 对于一元运算符
    一元运算符只作用于一个命题变元 P P P,有四种可能的结果

    P P P f 1 f 2 f 3 f 4 \begin{matrix}f_1&f_2&f_3&f_4\end{matrix} f1f2f3f4
    0 0 0 0    0   1    1 \begin{matrix}0&~~0&~1&~~1\end{matrix} 0  0 1  1
    1 1 1 0    1   0    1 \begin{matrix}0&~~1&~0&~~1\end{matrix} 0  1 0  1

    其中, f 1 P ⇔ F f_1P\Leftrightarrow F f1PF f 2 P ⇔ P f_2P\Leftrightarrow P f2PP f 3 P ⇔ ¬ P f_3P\Leftrightarrow\lnot P f3P¬P f 3 P ⇔ T f_3P\Leftrightarrow T f3PT
    可见,对于一元运算符的每一种运算结果都能用以上 9 个联结词表达

  2. 对于二元运算符
    二元运算符只作用于两个命题变元 P ,   Q P,\ Q P, Q,有十六种可能的结果

    P P P Q Q Q f 1 f 2 f 3 f 4 f 5 f 6 f 7 f 8 f 9 f 10 f 11 f 12 f 13 f 14 f 15 f 16 \begin{matrix}f_1&f_2&f_3&f_4&f_5&f_6&f_7&f_8&f_9&f_{10}&f_{11}&f_{12}&f_{13}&f_{14}&f_{15}&f_{16}\end{matrix} f1f2f3f4f5f6f7f8f9f10f11f12f13f14f15f16
    0 0 0 0 0 0 0    0   0    0   0    0   0    0   1     1     1     1     1     1     1     1 \begin{matrix}0&~~0&~0&~~0&~0&~~0&~0&~~0&~1&~~~1&~~~1&~~~1&~~~1&~~~1&~~~1&~~~1\end{matrix} 0  0 0  0 0  0 0  0 1   1   1   1   1   1   1   1
    0 0 0 1 1 1 0    0   0    0   1    1   1    1   0     0     0     0     1     1     1     1 \begin{matrix}0&~~0&~0&~~0&~1&~~1&~1&~~1&~0&~~~0&~~~0&~~~0&~~~1&~~~1&~~~1&~~~1\end{matrix} 0  0 0  0 1  1 1  1 0   0   0   0   1   1   1   1
    1 1 1 0 0 0 0    0   1    1   0    0   1    1   0     0     1     1     0     0     1     1 \begin{matrix}0&~~0&~1&~~1&~0&~~0&~1&~~1&~0&~~~0&~~~1&~~~1&~~~0&~~~0&~~~1&~~~1\end{matrix} 0  0 1  1 0  0 1  1 0   0   1   1   0   0   1   1
    1 1 1 1 1 1 0    1   0    1   0    1   0    1   0     1     0     1     0     1     0     1 \begin{matrix}0&~~1&~0&~~1&~0&~~1&~0&~~1&~0&~~~1&~~~0&~~~1&~~~0&~~~1&~~~0&~~~1\end{matrix} 0  1 0  1 0  1 0  1 0   1   0   1   0   1   0   1

    其中, P f 1 Q ⇔ F Pf_1Q\Leftrightarrow F Pf1QF P f 2 Q ⇔ P ∧ Q Pf_2Q\Leftrightarrow P\land Q Pf2QPQ P f 3 Q ⇔ P ↛ Q Pf_3Q\Leftrightarrow P\nrightarrow Q Pf3QPQ P f 4 Q ⇔ P Pf_4Q\Leftrightarrow P Pf4QP P f 5 Q ⇔ Q ↛ P Pf_5Q\Leftrightarrow Q\nrightarrow P Pf5QQP P f 6 Q ⇔ Q Pf_6Q\Leftrightarrow Q Pf6QQ P f 7 Q ⇔ P ⊕ Q Pf_7Q\Leftrightarrow P\oplus Q Pf7QPQ P f 8 Q ⇔ P ∨ Q Pf_8Q\Leftrightarrow P\lor Q Pf8QPQ P f 9 Q ⇔ P ↓ Q Pf_9Q\Leftrightarrow P\downarrow Q Pf9QPQ P f 10 Q ⇔ P ↔ Q Pf_{10}Q\Leftrightarrow P\leftrightarrow Q Pf10QPQ P f 11 Q ⇔ ¬ Q Pf_{11}Q\Leftrightarrow\lnot Q Pf11Q¬Q P f 12 Q ⇔ Q → P Pf_{12}Q\Leftrightarrow Q\rightarrow P Pf12QQP P f 13 Q ⇔ ¬ P Pf_{13}Q\Leftrightarrow\lnot P Pf13Q¬P P f 14 Q ⇔ P → Q Pf_{14}Q\Leftrightarrow P\rightarrow Q Pf14QPQ P f 15 Q ⇔ P ↑ Q Pf_{15}Q\Leftrightarrow P\uparrow Q Pf15QPQ P f 16 Q ⇔ T Pf_{16}Q\Leftrightarrow T Pf16QT
    可见,对于二元运算符的每一种运算结果都可以用以上 9 中联结词表达

但是这 9 个联结词并非相互独立的,某些联结词可以用另外一些联结词等价表示,如 P → Q ⇔ ¬ P ∨ Q P\rightarrow Q\Leftrightarrow\lnot P\lor Q PQ¬PQ

由等价公式
P → Q ⇔ ¬ P ∨ Q P ↔ Q ⇔ ( P → Q ) ∧ ( Q → P ) P ↛ Q ⇔ ¬ ( P → Q ) P ⊕ Q ⇔ ¬ ( P ↔ Q ) P ↓ Q ⇔ ¬ ( P ∨ Q ) P ↑ Q ⇔ ¬ ( P ∧ Q ) \begin{aligned} P\rightarrow Q&\Leftrightarrow\lnot P\lor Q\\ P\leftrightarrow Q&\Leftrightarrow(P\rightarrow Q)\land(Q\rightarrow P)\\ P\nrightarrow Q&\Leftrightarrow\lnot(P\rightarrow Q)\\ P\oplus Q&\Leftrightarrow\lnot(P\leftrightarrow Q)\\ P\downarrow Q&\Leftrightarrow\lnot(P\lor Q)\\ P\uparrow Q&\Leftrightarrow\lnot(P\land Q) \end{aligned} PQPQPQPQPQPQ¬PQ(PQ)(QP)¬(PQ)¬(PQ)¬(PQ)¬(PQ)
知:

  • ↓ \downarrow 可用 { ¬ ,   ∨ } \{\lnot,\ \lor\} { ¬, } 表示
  • ↑ \uparrow 可用 { ¬ ,   ∧ } \{\lnot,\ \land\} { ¬, } 表示
  • ⊕ \oplus 可用 { ¬ ,   ↔ } \{\lnot,\ \leftrightarrow\} { ¬, } 表示
  • ↔ \leftrightarrow 可用 { → ,   ∧ } \{\rightarrow,\ \land\} { , } 表示
  • → \rightarrow 可用 { ¬ ,   ∨ } \{\lnot,\ \lor\} { ¬, } 表示

又由徳·摩根定律可知:

  • ∧ \land 可用 { ¬ ,   ∨ } \{\lnot,\ \lor\} { ¬, } 表示
  • ∨ \lor 可用 { ¬ ,   ∧ } \{\lnot,\ \land\} { ¬, } 表示

因此任意命题公式都可由联结词集合 { ¬ ,   ∨ } \{\lnot,\ \lor\} { ¬, } { ¬ ,   ∧ } \{\lnot,\ \land\} { ¬, } 等价表示

全功能联结词集合

对于一个联结词集合,如果所有命题公式都能由其中的联结词等价表示,则称此联结词集合为全功能联结词集合,又称此联结词集合是功能完备的

极小全功能联结词集合

对于一个极小全功能联结词集合,需满足两个条件:

  1. 该联结词集合是全功能联结词集合
  2. 去掉其中任意一个联结词所得的联结词集合都不是全功能联结词集合

常见的极小全功能联结词集合有, { ¬ ,   ∨ } \{\lnot,\ \lor\} { ¬, } { ¬ ,   ∧ } \{\lnot,\ \land\} { ¬, } { ↓ } \{\downarrow\} { } { ↑ } \{\uparrow\} { }

命题公式

定义

命题公式,又称命题合式公式,下面是其归纳定义:

  1. 基础条款:单个命题常元或命题变元是命题公式
  2. 归纳条款
    • A A A 是命题公式,则 ¬ A \lnot A ¬A 是命题公式
    • A A A B B B 是命题公式,则 A ∧ B A\land B AB A ∨ B A\lor B AB A → B A\rightarrow B AB A ↔ B A\leftrightarrow B AB 是命题公式
  3. 极小性条款:只有有限次地应用条款 1 和条款 2 生成的表达式才是命题公式

命题公式常用大写字母 A , B , C , ⋯ A,B,C,\cdots A,B,C, 表示
需要注意的是不要把命题和命题公式弄混了
如:命题 A ,   B ,   C A,\ B,\ C A, B, C 组成的命题公式 ( A ∨ B ) → C (A\lor B)\rightarrow C (AB)C 可用 P P P 代表此公式

命题公式不是命题,没有真值,只有对其进行赋值后才有真值

命题的符号化

将自然语言命题写成与之内涵相同的命题公式称为命题的符号化

下面演示如何将命题符号化:
P P P:明天下雨, Q Q Q:明天下雪, R R R:我去上课
可以用命题公式 ( P ∨ Q ) → ¬ R (P\lor Q)\rightarrow \lnot R (PQ)¬R 表示命题 “如果明天下雨或下雪,那么我不去上课”

子公式

B B B 是命题公式 A A A 的一个连续段 B B B 是命题公式,则称 B B B A A A子公式

如:命题公式 ( P ∧ Q ) → ( ¬ P ∨ ( P ↔ Q ) ) (P\land Q)\rightarrow(\lnot P\lor(P\leftrightarrow Q)) (PQ)(¬P(PQ)) 的子公式有 P P P Q Q Q P ∧ Q P\land Q PQ ¬ P \lnot P ¬P P ↔ Q P\leftrightarrow Q PQ ¬ P ∨ ( P ↔ Q ) \lnot P\lor (P\leftrightarrow Q) ¬P(PQ)
( P ∧ Q ) → (P\land Q)\rightarrow (PQ) 并非子公式,因为它不是命题公式

赋值

命题公式的真值由其所含命题变元的真值决定

为命题公式中的所有命题变元指定一组真值称为对该命题公式赋值(指派、解释)

若一个命题公式含有 n n n 个命题变元,那么它就有 2 n 2^n 2n 种不同的赋值,因为每个命题变元可以有 F F F T T T 两个赋值

分类

依据命题公式的取值

下面这幅文氏图表明了各种分类的关系:
Insert image description here

可满足式=重言式+偶然式

重言式

若一个命题公式在任意赋值下,它的真值都为 T T T,则称该命题公式为重言式,又称永真式

矛盾式

若一个命题公式在任意赋值下,它的真值都为 F F F,则称该命题公式为矛盾式,又称永假式

偶然式

若一个命题公式有真值为 T T T 的赋值,也有真值为 F F F 的赋值,则称该命题公式为偶然式

可满足式

若一个命题公式至少有一个真值为 T T T 的赋值,则称该命题公式为可满足式

等价与蕴含

等价
定义

A , B A,B A,B 为两个命题公式, P 1 , P 2 , ⋯   , P n P_1,P_2,\cdots,P_n P1,P2,,Pn 为所有出现在 A , B A,B A,B 中的命题变元,但 P i ,   i = 1 , 2 , ⋯   , n P_i,\ i=1,2,\cdots,n Pi, i=1,2,,n 不一定都同时出现在 A A A B B B 中。若对于 P 1 , P 2 , ⋯   , P n P_1,P_2,\cdots,P_n P1,P2,,Pn 的任意一组赋值, A A A B B B 的真值都相同,则称 A A A B B B 逻辑等价(logically equivalent),记作 A ⇔ B A\Leftrightarrow B AB,读作 “ A A A 等价于 B B B

Logical equivalence can be compared to the equal sign in algebra

The relationship between equivalence and biconditional connectives

P P P andQQQ is logically equivalent if and only ifP ↔ QP\leftrightarrow QPQ is a tautology

proving process

Proof:
By the definition of biconditional connective: P ↔ QP\leftrightarrow QPQ is true if and only ifPPP andQQThe truth values ​​of Q
are the same andP ↔ QP\leftrightarrow QPQ is a tautology, that is,P ↔ QP\leftrightarrow QPQ is always true
and you can getPPP andQQThe true values ​​of Q are the same, and PP
can be obtainedP andQQQ logical equivalence

##### Common equivalent formulas|Laws|Formulas| |:-:|:-:| |Conjunction laws|$\lnot\lnot P\Leftrightarrow P$| |Impotence laws|$P\land P\ Leftrightarrow P$
$P\lor P\Leftrightarrow P$| |Commutative law|$P\land Q\Leftrightarrow Q\land P$ $P\lor Q\Leftrightarrow Q\lor P$| |
Commutative law|$P\land (Q\land R)\Leftrightarrow(P\land Q)\land R$ $
P\lor(Q\lor R)\Leftrightarrow(P\lor Q)\lor R$| |Distributive Law|$P\land( Q\lor R)\Leftrightarrow(P\land Q)\lor(P\land R)$ $
P\lor(Q\land R)\Leftrightarrow(P\lor Q)\land(P\lor R)$| | De Morgan's Law |$\lnot(P\land Q)\Leftrightarrow\lnot P\lor\lnot Q$ $\lnot(
P\lor Q)\Leftrightarrow\lnot P\land \lnot Q$| |**Absorption Law**|$P\land(P\lor Q)\Leftrightarrow P$
$P\lor(P\land Q)\Leftrightarrow P$| |**Law of Implication**|$P\rightarrow Q\Leftrightarrow \lnot P\lor Q$| |Biconditional law|$P\leftrightarrow Q\Leftrightarrow(P\rightarrow Q)\land(Q\rightarrow P)$| |Zero is equal|$P\land F\Leftrightarrow F$ $
P \lor T\Leftrightarrow T$| |Law of Identity|$P\land T\Leftrightarrow P$ $
P\lor F\Leftrightarrow P$| |Law of Contradiction|$P\land\lnot P\Leftrightarrow F$| |Law of Excluded Middle|$ P\lor\lnot P\Leftrightarrow T$| |**Law of output**|$(P\land Q)\rightarrow R\Leftrightarrow P\rightarrow(Q\rightarrow R)$| |**Law of reductio ad absurdum** |$(P\rightarrow Q)\land(P\rightarrow\lnot Q)\Leftrightarrow\lnot P$| | **Inverse law** |$P\rightarrow Q\Leftrightarrow\lnot Q\rightarrow\lnot P$| #### Implication##### Definition $P$ and $Q$ are propositional formulas, if $P\rightarrow Q$ is a tautology Formula, then $P$ is said to imply $Q$, and is denoted as $P\Rightarrow Q$ ##### See the definition for the relationship between implication and conditional connectives ##### The relationship between implication and equivalence $P,Q$ is a propositional formula, $P\Leftrightarrow Q$ if and only if $P\Rightarrow Q$ and $Q\Rightarrow P$

Therefore the usual equivalence formulas also apply to implications

nature

A , B , C A,B,C A,B,C is the propositional formula

  • A ⇒ B A\Rightarrow B AB andAAA is a tautology, thenBBB is also a tautology

    proving process

    ∵ A ⇒ B \because A\Rightarrow B AB
    ∴ A → B \therefore A\rightarrow B AB is a tautology
    ∵ A \because AA is a tautology, that is,AAA must beTTT
    ∴ B \therefore B B 也必为 T T T,即为重言式

  • A ⇒ B A\Rightarrow B AB A ⇒ C A\Rightarrow C AC,则 A ⇒ ( B ∧ C ) A\Rightarrow(B\land C) A(BC)

    证明过程

    下面用肯定前件法证明
    ∵ A ⇒ B ,   A ⇒ C \because A\Rightarrow B,\ A\Rightarrow C AB, AC
    ∴ A → B ,   A → C \therefore A\rightarrow B,\ A\rightarrow C AB, AC 为重言式
    ∴ A \therefore A A T T T 时, B ,   C B,\ C B, C 必为 T T T B ∧ C B\land C BC T T T
    ∴ A ⇒ ( B ∧ C ) \therefore A\Rightarrow(B\land C) A(BC)

  • A ⇒ C A\Rightarrow C AC B ⇒ C B\Rightarrow C BC,则 ( A ∨ B ) ⇒ C (A\lor B)\Rightarrow C (AB)C

    证明过程

    下面用肯定前件法证明
    ∵ A ⇒ C ,   B ⇒ C \because A\Rightarrow C,\ B\Rightarrow C AC, BC
    ∴ A → C ,   B → C \therefore A\rightarrow C,\ B\rightarrow C AC, BC 为重言式
    ∴ A \therefore A A T T T 时, C C C 必为 T T T B B B T T T 时, C C C 必为 T T T
    ∴ A ∨ B \therefore A\lor B AB T T T 时, C C C 必为 T T T
    ∴ ( A ∨ B ) ⇒ C \therefore (A\lor B)\Rightarrow C (AB)C

常见蕴含公式
定律 公式
直推式 P ⇒ P P\Rightarrow P PP
化简式 P ∧ Q ⇒ P P\land Q\Rightarrow P PQP
P ∧ Q ⇒ Q P\land Q\Rightarrow Q PQQ
附加式 P ⇒ P ∨ Q P\Rightarrow P\lor Q PPQ
Q ⇒ P ∨ Q Q\Rightarrow P\lor Q QPQ
变形附加式 1
P P P ¬ P \lnot P ¬P 代入)
¬ P ⇒ P → Q \lnot P\Rightarrow P\rightarrow Q ¬PPQ
Q ⇒ P → Q Q\Rightarrow P\rightarrow Q QPQ
变形附加式 2
(式 1 用逆反律)
¬ ( P → Q ) ⇒ P \lnot(P\rightarrow Q)\Rightarrow P ¬(PQ)P
¬ ( P → Q ) ⇒ ¬ Q \lnot(P\rightarrow Q)\Rightarrow \lnot Q ¬(PQ)¬Q
假言推理 P ∧ ( P → Q ) ⇒ Q P\land(P\rightarrow Q)\Rightarrow Q P(PQ)Q
拒取式 ¬ Q ∧ ( P → Q ) ⇒ ¬ P \lnot Q\land(P\rightarrow Q)\Rightarrow \lnot P ¬Q(PQ)¬P
析取三段论 ¬ P ∧ ( P ∨ Q ) ⇒ Q \lnot P\land(P\lor Q)\Rightarrow Q ¬P(PQ)Q
前提三段论 ( P → Q ) ∧ ( Q → R ) ⇒ ( P → R ) (P\rightarrow Q)\land (Q\rightarrow R)\Rightarrow (P\rightarrow R) (PQ)(QR)(PR)
构造性二难推理 ( P ∨ Q ) ∧ ( P → R ) ∧ ( Q → S ) ⇒ R ∨ S (P\lor Q)\land(P\rightarrow R)\land(Q\rightarrow S)\Rightarrow R\lor S (PQ)(PR)(QS)RS
破坏性二难推理 ( ¬ R ∨ ¬ S ) ∧ ( P → R ) ∧ ( Q → S ) ⇒ ¬ P ∨ ¬ Q (\lnot R\lor \lnot S)\land(P\rightarrow R)\land(Q\rightarrow S)\Rightarrow \lnot P\lor \lnot Q (¬R¬S)(PR)(QS)¬P¬Q
合取二难推理 ( P ∧ Q ) ∧ ( P → R ) ∧ ( Q → S ) ⇒ R ∧ S (P\land Q)\land(P\rightarrow R)\land(Q\rightarrow S)\Rightarrow R\land S (PQ)(PR)(QS)RS
逆条件附加 ( P → Q ) ⇒ ( Q → R ) → ( P → R ) (P\rightarrow Q)\Rightarrow(Q\rightarrow R)\rightarrow(P\rightarrow R) (PQ)(QR)(PR)
条件归并 ( P → Q ) ∧ ( R → S ) ⇒ ( P ∧ R ) → ( Q ∧ S ) (P\rightarrow Q)\land(R\rightarrow S)\Rightarrow(P\land R)\rightarrow(Q\land S) (PQ)(RS)(PR)(QS)
双条件三段论 ( P ↔ Q ) ∧ ( Q ↔ R ) ⇒ P ↔ R (P\leftrightarrow Q)\land(Q\leftrightarrow R)\Rightarrow P\leftrightarrow R (PQ)(QR)PR
前后件附加 P → Q ⇒ ( P ∨ R ) → ( Q ∨ R ) P\rightarrow Q\Rightarrow(P\lor R)\rightarrow(Q\lor R) PQ(PR)(QR)
P → Q ⇒ ( P ∧ R ) → ( Q ∧ R ) P\rightarrow Q\Rightarrow(P\land R)\rightarrow(Q\land R) PQ(PR)(QR)

常用于证明 A ⇒ B A\Rightarrow B AB 的方法:

  1. 肯定前件法
    假设 A A A T T T,若能推出 B B B 也为 T T T,则 A ⇒ B A\Rightarrow B AB

    因为 A A A T T T 时, B B B 必为 T T T A → B A\rightarrow B AB T T T
    A A A F F F 时, A → B A\rightarrow B AB T T T
    因此 A → B A\rightarrow B AB 为重言式

  2. 否定后件法:
    假设 B B B F F F,若能推出 A A A 也为 F F F,则 A ⇒ B A\Rightarrow B AB

    A → B A\rightarrow B AB F F F 时,当且仅当 A A A T T T B B B F F F
    而我们得到 B B B F F F 时, A A A 必为 F F F。因此 A → B A\rightarrow B AB 为重言式

  3. 真值表法
    列出 A , B , A → B A,B,A\rightarrow B A,B,AB 的真值表,证明 A → B A\rightarrow B AB 为重言式
三个规则
代入规则

A , B , C A,B,C A,B,C 是命题公式, P P P 为同时出现在 A , B A,B A,B 中的命题变元。用 C C C 代替 P P P A , B A,B A,B 中每次出现 P P P 的地方都要用 C C C 代替)得 A ′ , B ′ A^{'},B^{'} A,B

  • A ⇔ B A\Leftrightarrow B AB,则 A ′ ⇔ B ′ A^{'}\Leftrightarrow B^{'} AB
  • A ⇒ B A\Rightarrow B AB,则 A ′ ⇒ B ′ A^{'}\Rightarrow B^{'} AB
替换规则

A , X , Y A,X,Y A,X,Y 是命题公式, X X X A A A 的子公式, X ⇔ Y X\Leftrightarrow Y XY。若将 A A A 中的 X X X Y Y Y 替换(不必每一处都替换)后得 B B B,则 A ⇔ B A\Leftrightarrow B AB

传递规则

A , B , C A,B,C A,B,C 是命题公式

  • A ⇔ B A\Leftrightarrow B AB B ⇔ C B\Leftrightarrow C BC,则 A ⇔ C A\Leftrightarrow C AC

    证明过程

    ∵ A ⇔ B ,   B ⇔ C \because A\Leftrightarrow B,\ B\Leftrightarrow C AB, BC
    ∴ A \therefore A A B B B B B B C C C 的真值相同
    ∴ A \therefore A A C C C 的真值相同
    ∴ A ⇔ C \therefore A\Leftrightarrow C AC

  • A ⇒ B A\Rightarrow B AB B ⇒ C B\Rightarrow C BC,则 A ⇒ C A\Rightarrow C AC

    证明过程

    下面用肯定前件法证明
    ∵ A ⇒ B ,   B ⇒ C \because A\Rightarrow B,\ B\Rightarrow C AB, BC
    ∴ A → B ,   B → C \therefore A\rightarrow B,\ B\rightarrow C AB, BC 为重言式
    ∴ A \therefore A A T T T 时, B B B 必为 T T T C C C 也必为 T T T
    ∴ A ⇒ C \therefore A\Rightarrow C AC

对偶式

定义

设命题公式 A A A 仅含有联结词 ¬ ,   ∧ ,   ∨ \lnot,\ \land,\ \lor ¬, , 。若将 A A A ∧ \land 换成 ∨ \lor ∨ \lor 换成 ∧ \land ,常元 T T T 换成 F F F F F F 换成 T T T。替换后的命题公式记作 A ∗ A^* A,则称 A ∗ A^* A A A A对偶公式,简称对偶式

性质

A ,   B A,\ B A, B 为命题公式,联结词仅含有 ¬ ,   ∧ ,   ∨ \lnot,\ \land,\ \lor ¬, ,  A ∗ ,   B ∗ A^*,\ B^* A, B 为其对偶式

  • ¬ A ( P 1 , P 2 , ⋯   , P n ) ⇔ A ∗ ( ¬ P 1 , ¬ P 2 , ⋯   , ¬ P n ) \lnot A(P_1,P_2,\cdots,P_n)\Leftrightarrow A^*(\lnot P_1,\lnot P_2,\cdots,\lnot P_n) ¬A(P1,P2,,Pn)A(¬P1,¬P2,,¬Pn)
    其中 P 1 , P 2 , ⋯   , P n P_1,P_2,\cdots,P_n P1,P2,,Pn 是出现在 A A A 中的所有命题变元

    证明过程

    德·摩根定律
    当减少 ¬ \lnot ¬ 的辖域时, ∧ \land ∨ \lor 互换、 T T T F F F 互换、 P i P_i Pi 变为 ¬ P i \lnot P_i ¬Pi
    与对偶式的定义相比就是多了 P i P_i Pi 变为 ¬ P i \lnot P_i ¬Pi 的过程

  • A ⇔ B A\Leftrightarrow B AB,则 A ∗ ⇔ B ∗ A^*\Leftrightarrow B^* AB

    证明过程

    P 1 , P 2 , ⋯   , P n P_1,P_2,\cdots,P_n P1,P2,,Pn 为出现在 A ,   B A,\ B A, B 的所有命题变元
    代入规则
    A ( ¬ P 1 , ¬ P 2 , ⋯   , ¬ P n ) ⇔ B ( ¬ P 1 , ¬ P 2 , ⋯   , ¬ P n ) A(\lnot P_1,\lnot P_2,\cdots,\lnot P_n)\Leftrightarrow B(\lnot P_1,\lnot P_2,\cdots,\lnot P_n) A(¬P1,¬P2,,¬Pn)B(¬P1,¬P2,,¬Pn)
    ∵ ¬ A ( ¬ P 1 , ¬ P 2 , ⋯   , ¬ P n ) ⇔ A ∗ ( P 1 , P 2 , ⋯   , P n ) \because \lnot A(\lnot P_1,\lnot P_2,\cdots,\lnot P_n)\Leftrightarrow A^*(P_1,P_2,\cdots,P_n) ¬A(¬P1,¬P2,,¬Pn)A(P1,P2,,Pn)
    ∴ A ( ¬ P 1 , ¬ P 2 , ⋯   , ¬ P n ) ⇔ ¬ A ∗ ( P 1 , P 2 , ⋯   , P n ) \therefore A(\lnot P_1,\lnot P_2,\cdots,\lnot P_n)\Leftrightarrow\lnot A^*(P_1,P_2,\cdots,P_n) A(¬P1,¬P2,,¬Pn)¬A(P1,P2,,Pn)
    同理得 B ( ¬ P 1 , ¬ P 2 , ⋯   , ¬ P n ) ⇔ ¬ B ∗ ( P 1 , P 2 , ⋯   , P n ) B(\lnot P_1,\lnot P_2,\cdots,\lnot P_n)\Leftrightarrow\lnot B^*(P_1,P_2,\cdots,P_n) B(¬P1,¬P2,,¬Pn)¬B(P1,P2,,Pn)
    ∴ ¬ A ∗ ( P 1 , P 2 , ⋯   , P n ) ⇔ ¬ B ∗ ( P 1 , P 2 , ⋯   , P n ) \therefore \lnot A^*(P_1,P_2,\cdots,P_n)\Leftrightarrow\lnot B^*(P_1,P_2,\cdots,P_n) ¬A(P1,P2,,Pn)¬B(P1,P2,,Pn),由传递规则
    ∴ A ∗ ( P 1 , P 2 , ⋯   , P n ) ⇔ B ∗ ( P 1 , P 2 , ⋯   , P n ) \therefore A^*(P_1,P_2,\cdots,P_n)\Leftrightarrow B^*(P_1,P_2,\cdots,P_n) A(P1,P2,,Pn)B(P1,P2,,Pn)

  • A ⇒ B A\Rightarrow B AB,则 B ∗ ⇒ A ∗ B^*\Rightarrow A^* BA

    证明过程

    代入规则
    A ( ¬ P 1 , ¬ P 2 , ⋯   , ¬ P n ) ⇒ B ( ¬ P 1 , ¬ P 2 , ⋯   , ¬ P n ) A(\lnot P_1,\lnot P_2,\cdots,\lnot P_n)\Rightarrow B(\lnot P_1,\lnot P_2,\cdots,\lnot P_n) A(¬P1,¬P2,,¬Pn)B(¬P1,¬P2,,¬Pn)
    ∵ ¬ A ( ¬ P 1 , ¬ P 2 , ⋯   , ¬ P n ) ⇔ A ∗ ( P 1 , P 2 , ⋯   , P n ) \because \lnot A(\lnot P_1,\lnot P_2,\cdots,\lnot P_n)\Leftrightarrow A^*(P_1,P_2,\cdots,P_n) ¬A(¬P1,¬P2,,¬Pn)A(P1,P2,,Pn)
    ∴ A ( ¬ P 1 , ¬ P 2 , ⋯   , ¬ P n ) ⇔ ¬ A ∗ ( P 1 , P 2 , ⋯   , P n ) \therefore A(\lnot P_1,\lnot P_2,\cdots,\lnot P_n)\Leftrightarrow\lnot A^*(P_1,P_2,\cdots,P_n) A(¬P1,¬P2,,¬Pn)¬A(P1,P2,,Pn)
    同理得 B ( ¬ P 1 , ¬ P 2 , ⋯   , ¬ P n ) ⇔ ¬ B ∗ ( P 1 , P 2 , ⋯   , P n ) B(\lnot P_1,\lnot P_2,\cdots,\lnot P_n)\Leftrightarrow\lnot B^*(P_1,P_2,\cdots,P_n) B(¬P1,¬P2,,¬Pn)¬B(P1,P2,,Pn)
    ∴ ¬ A ∗ ( P 1 , P 2 , ⋯   , P n ) ⇒ ¬ B ∗ ( P 1 , P 2 , ⋯   , P n ) \therefore \lnot A^*(P_1,P_2,\cdots,P_n)\Rightarrow \lnot B^*(P_1,P_2,\cdots,P_n) ¬A(P1,P2,,Pn)¬B(P1,P2,,Pn)
    逆反律
    B ∗ ⇒ A ∗ B^*\Rightarrow A^* BA

范式

一个命题公式有多种等价表达形式,为了统一,需要将命题公式进行规范化

主析取范式

在了解主析取范式时需要先了解合取式和析取范式两个概念

合取式

若干个命题变元仅由联结词 { ¬ ,   ∧ } \{\lnot,\ \land\} { ¬, } 所组成的命题公式称为合取式

如: P ,   P ∧ Q ,   ¬ P ∧ Q P,\ P\land Q,\ \lnot P\land Q P, PQ, ¬PQ 都是合取式

注意:合取式不含命题常元

析取范式

析取范式具有如下形式:
A 1 ∨ A 2 ∨ ⋯ ∨ A n      ( n ≥ 1 ) A_1\lor A_2\lor\cdots\lor A_n~~~~(n\geq 1) A1A2An    (n1)
其中, A 1 , A 2 , ⋯   , A n A_1,A_2,\cdots,A_n A1,A2,,An 为合取式

析取范式不唯一

如: ( P ∧ ¬ P ) ∨ ( ¬ P ∧ Q ) ∨ ( P ∧ ¬ Q ) (P\land\lnot P)\lor(\lnot P\land Q)\lor(P\land\lnot Q) (P¬P)(¬PQ)(P¬Q) 是析取范式
但是它的另一种等价形式 ( ¬ P ∧ Q ) ∨ ( P ∧ ¬ Q ) (\lnot P\land Q)\lor(P\land\lnot Q) (¬PQ)(P¬Q) 也是析取范式

极小项

若一个命题公式为合取式,且满足其中每个命题变元与其否定不能同时出现,但必出现其一,则称该合取式为极小项

若干个命题变元能组成极小项的个数:

  1. 两个命题变元 P ,   Q P,\ Q P, Q 组成的极小项有四个,分别为
    ¬ P ∧ ¬ Q \lnot P\land\lnot Q ¬P¬Q ¬ P ∧ Q \lnot P\land Q ¬PQ P ∧ ¬ Q P\land\lnot Q P¬Q P ∧ Q P\land Q PQ
  2. n n n 个命题变元 P 1 , P 2 , ⋯   , P n P_1,P_2,\cdots,P_n P1,P2,,Pn 组成的极小项有 2 n 2^n 2n 个,分别为
    P ~ 1 ∧ P ~ 2 ∧ ⋯ ∧ P ~ n \widetilde P_1\land\widetilde P_2\land\cdots\land\widetilde P_n P 1P 2P n
    其中 P ~ i \widetilde P_i P i 要么为 P i P_i Pi 要么为 ¬ P i \lnot P_i ¬Pi

极小项的编码:
可以将 n n n 个命题变元组成的极小项编码成长度为 n n n 的二进制串

  • P ~ i \widetilde P_i P i ¬ P i \lnot P_i ¬Pi 时,二进制串第 i i i 位取值为 0 0 0
  • P ~ i \widetilde P_i P i P i P_i Pi 时,二进制串第 i i i 位取值为 1 1 1

以两个命题变元 P ,   Q P,\ Q P, Q 为例:

  • m 0 = m 00 = ¬ P ∧ ¬ Q m_0=m_{00}=\lnot P\land\lnot Q m0=m00=¬P¬Q
  • m 1 = m 01 = ¬ P ∧ Q m_1=m_{01}=\lnot P\land Q m1=m01=¬PQ
  • m 2 = m 10 = P ∧ ¬ Q m_2=m_{10}= P\land\lnot Q m2=m10=P¬Q
  • m 3 = m 11 = P ∧ Q m_3=m_{11}= P\land Q m3=m11=PQ
P P P Q Q Q ¬ P ∧ ¬ Q \lnot P\land\lnot Q ¬P¬Q ¬ P ∧ Q \lnot P\land Q ¬PQ P ∧ ¬ Q P\land\lnot Q P¬Q P ∧ Q P\land Q PQ
0 0 1 0 0 0
0 1 0 1 0 0
1 0 0 0 1 0
1 1 0 0 0 1

极小项有以下性质:

  • 唯一性。没有两个极小项是等价的
  • 只有与其二进制编码串一样的赋值才能使其值为 T T T,其余都为 F F F
  • 任意两个不同的极小项的合取为矛盾式
  • 所有极小项的析取为重言式
定义

主析取范式具有如下形式:
A 1 ′ ∨ A 2 ′ ∨ ⋯ ∨ A n ′      ( n ≥ 1 ) A_1^{'}\lor A_2^{'}\lor\cdots\lor A_n^{'}~~~~(n\geq 1) A1A2An    (n1)
其中, A 1 ′ , A 2 ′ , ⋯   , A n ′ A_1^{'},A_2^{'},\cdots,A_n^{'} A1,A2,,An 为极小项

对于命题公式 A A A,若由其所有命题变元所构成的主析取范式与 A A A 等价,则称此主析取范式为命题公式 A A A 的主析取范式

如: P ↔ Q P\leftrightarrow Q PQ 的主析取范式为 ( ¬ P ∧ ¬ Q ) ∨ ( P ∧ Q ) (\lnot P\land\lnot Q)\lor(P\land Q) (¬P¬Q)(PQ)
P ↔ Q ⇔ ( P → Q ) ∧ ( Q → P ) ⇔ ( ¬ P ∨ Q ) ∧ ( ¬ Q ∨ P ) ⇔ [ ( ¬ P ∨ Q ) ∧ ¬ Q ] ∨ [ ( ¬ P ∨ Q ) ∧ P ] ⇔ [ ( ¬ P ∧ ¬ Q ) ∨ ( Q ∧ ¬ Q ) ] ∨ [ ( ¬ P ∧ P ) ∨ ( Q ∧ P ) ] ⇔ ( ¬ P ∧ ¬ Q ) ∨ ( P ∧ Q ) \begin{aligned} P\leftrightarrow Q&\Leftrightarrow(P\rightarrow Q)\land(Q\rightarrow P)\\ &\Leftrightarrow(\lnot P\lor Q)\land(\lnot Q\lor P)\\ &\Leftrightarrow[(\lnot P\lor Q)\land\lnot Q]\lor[(\lnot P\lor Q)\land P]\\ &\Leftrightarrow[(\lnot P\land\lnot Q)\lor(Q\land\lnot Q)]\lor[(\lnot P\land P)\lor(Q\land P)]\\ &\Leftrightarrow(\lnot P\land\lnot Q)\lor(P\land Q) \end{aligned} PQ(PQ)(QP)(¬PQ)(¬QP)[(¬PQ)¬Q][(¬PQ)P][(¬P¬Q)(Q¬Q)][(¬PP)(QP)](¬P¬Q)(PQ)
命题公式 A A A 的主析取范式可以表示为

  • m 00 ∨ m 11 m_{00}\lor m_{11} m00m11
  • m 0 ∨ m 3 m_{0}\lor m_{3} m0m3
  • ∑ ( 0 ,   3 ) \sum(0,\ 3) (0, 3)
求法

设有命题公式 A A A,需求出它的主析取范式

  • 等价变换法
    用等价变换直接推导出 A A A 的主析取范式

  • 真值表法
    A A A 的真值表中,使 A A A 真值为 T T T 的所有赋值所对应的极小项构成的析取范式为 A A A 的主析取范式

    原因理解

    因为极小项只有一个赋值使其真值为 T T T
    而极小项之间的析取其实就是增加真值为 T T T 的赋值
    A A A 所有真值为 T T T 所对应的极小项的析取的真值表自然与 A A A 一样

主合取范式

在了解主合取范式时需要先了解析取式和合取范式两个概念

析取式

若干个命题变元仅由联结词 { ¬ ,   ∨ } \{\lnot,\ \lor\} { ¬, } 所组成的命题公式称为析取式

如: P ,   P ∨ Q ,   ¬ P ∨ Q P,\ P\lor Q,\ \lnot P\lor Q P, PQ, ¬PQ 都是析取式

注意:析取式不含命题常元

合取范式

合取范式具有如下形式:
A 1 ∧ A 2 ∧ ⋯ ∧ A n      ( n ≥ 1 ) A_1\land A_2\land\cdots\land A_n~~~~(n\geq 1) A1A2An    (n1)
其中, A 1 , A 2 , ⋯   , A n A_1,A_2,\cdots,A_n A1,A2,,An 为析取式

合取范式也不唯一

如: ( P ∨ ¬ P ) ∧ ( ¬ P ∨ Q ) ∧ ( P ∨ ¬ Q ) (P\lor\lnot P)\land(\lnot P\lor Q)\land(P\lor\lnot Q) (P¬P)(¬PQ)(P¬Q) 是合取范式
但是它的另一种等价形式 ( ¬ P ∧ Q ) ∨ ( P ∧ ¬ Q ) (\lnot P\land Q)\lor(P\land\lnot Q) (¬PQ)(P¬Q) 也是合取范式

极大项

若一个命题公式为析取式,且满足其中每个命题变元与其否定不能同时出现,但必出现其一,则称该析取式为极大项

若干个命题变元能组成极大项的个数:

  1. 两个命题变元 P ,   Q P,\ Q P, Q 组成的极大项有四个,分别为
    ¬ P ∨ ¬ Q \lnot P\lor\lnot Q ¬P¬Q ¬ P ∨ Q \lnot P\lor Q ¬PQ P ∨ ¬ Q P\lor\lnot Q P¬Q P ∨ Q P\lor Q PQ
  2. n n n 个命题变元 P 1 , P 2 , ⋯   , P n P_1,P_2,\cdots,P_n P1,P2,,Pn 组成的极小项有 2 n 2^n 2n 个,分别为
    P ~ 1 ∨ P ~ 2 ∨ ⋯ ∨ P ~ n \widetilde P_1\lor\widetilde P_2\lor\cdots\lor\widetilde P_n P 1P 2P n
    其中 P ~ i \widetilde P_i P i 要么为 P i P_i Pi 要么为 ¬ P i \lnot P_i ¬Pi

极大项的编码:
与极小项一样,也可以将 n n n 个命题变元组成的极大项编码成长度为 n n n 的二进制串,不过不同的是:

  • P ~ i \widetilde P_i P i ¬ P i \lnot P_i ¬Pi 时,二进制串第 i i i 位取值为 1 1 1
  • P ~ i \widetilde P_i P i P i P_i Pi 时,二进制串第 i i i 位取值为 0 0 0

以两个命题变元 P ,   Q P,\ Q P, Q 为例:

  • M 0 = M 00 = P ∨ Q M_0=M_{00}=P\lor Q M0=M00=PQ
  • M 1 = M 01 = P ∨ ¬ Q M_1=M_{01}=P\lor\lnot Q M1=M01=P¬Q
  • M 2 = M 10 = ¬ P ∨ Q M_2=M_{10}=\lnot P\lor Q M2=M10=¬PQ
  • M 3 = M 11 = ¬ P ∨ ¬ Q M_3=M_{11}=\lnot P\lor\lnot Q M3=M11=¬P¬Q
P P P Q Q Q P ∨ Q P\lor Q PQ P ∨ ¬ Q P\lor\lnot Q P¬Q ¬ P ∨ Q \lnot P\lor Q ¬PQ ¬ P ∨ ¬ Q \lnot P\lor\lnot Q ¬P¬Q
0 0 0 1 1 1
0 1 1 0 1 1
1 0 1 1 0 1
1 1 1 1 1 0

极大项有以下性质:

  • 唯一性。没有两个极大项是等价的
  • 只有与其二进制编码串一样的赋值才能使其值为 F F F,其余都为 T T T
  • 任意两个不同的极大项的析取为重言式
  • 所有极大项的合取为矛盾式
定义

主合取范式具有如下形式:
A 1 ′ ∧ A 2 ′ ∧ ⋯ ∧ A n ′      ( n ≥ 1 ) A_1^{'}\land A_2^{'}\land\cdots\land A_n^{'}~~~~(n\geq 1) A1A2An    (n1)
其中, A 1 ′ , A 2 ′ , ⋯   , A n ′ A_1^{'},A_2^{'},\cdots,A_n^{'} A1,A2,,An 为极大项

对于命题公式 A A A,若由其所有命题变元所构成的主合取范式与 A A A 等价,则称此主合取范式为命题公式 A A A 的主合取范式

如: P ↔ Q P\leftrightarrow Q PQ 的主合取范式为 ( P ∨ ¬ Q ) ∧ ( ¬ P ∨ Q ) (P\lor\lnot Q)\land(\lnot P\lor Q) (P¬Q)(¬PQ)
P ↔ Q ⇔ ( P → Q ) ∧ ( Q → P ) ⇔ ( ¬ P ∨ Q ) ∧ ( ¬ Q ∨ P ) ⇔ ( P ∨ ¬ Q ) ∧ ( ¬ P ∨ Q ) \begin{aligned} P\leftrightarrow Q&\Leftrightarrow(P\rightarrow Q)\land(Q\rightarrow P)\\ &\Leftrightarrow(\lnot P\lor Q)\land(\lnot Q\lor P)\\ &\Leftrightarrow(P\lor\lnot Q)\land(\lnot P\lor Q) \end{aligned} PQ(PQ)(QP)(¬PQ)(¬QP)(P¬Q)(¬PQ)
命题公式 A A A 的主合取范式可以表示为

  • M 01 ∧ M 10 M_{01}\land M_{10} M01M10
  • M 1 ∧ M 2 M_{1}\land M_{2} M1M2
  • ∏ ( 1 ,   2 ) \prod(1,\ 2) (1, 2)
求法

设有命题公式 A A A,需求出它的主合取范式

  • 等价变换法
    用等价变换直接推导出 A A A 的主合取范式

  • 真值表法
    A A A 的真值表中,使 A A A 真值为 F F F 的所有赋值所对应的极大项构成的合取范式为 A A A 的主合取范式

    原因理解

    因为极大项只有一个赋值使其真值为 F F F
    而极大项之间的合取其实就是增加真值为 F F F 的赋值
    A A A 所有真值为 T T T 所对应的极大项的合取的真值表自然与 A A A 一样

极小项与极大项的关系

对于极小项 m i m_i mi 以及极大项 M i M_i Mi,有
¬ m i ⇔ M i \lnot m_i\Leftrightarrow M_i ¬miMi

主析取范式和主合取范式的关系

n n n 个命题变元构成的命题公式 A A A 的主析取范式为 ∑ ( i 1 , i 2 , ⋯   , i k ) \sum(i_1,i_2,\cdots,i_k) (i1,i2,,ik)、主合取范式为 ∏ ( j 1 , j 2 , ⋯   , j t ) \prod(j_1,j_2,\cdots,j_t) (j1,j2,,jt),则有

  • { i 1 , i 2 , ⋯   , i k } ∪ { j 1 , j 2 , ⋯   , j t } = { 0 , 1 , ⋯   , 2 n − 1 } \{i_1,i_2,\cdots,i_k\}\cup\{j_1,j_2,\cdots,j_t\}=\{0,1,\cdots,2^n-1\} { i1,i2,,ik}{ j1,j2,,jt}={ 0,1,,2n1}
  • { i 1 , i 2 , ⋯   , i k } ∩ { j 1 , j 2 , ⋯   , j t } = ∅ \{i_1,i_2,\cdots,i_k\}\cap\{j_1,j_2,\cdots,j_t\}=\varnothing { i1,i2,,ik}{ j1,j2,,jt}=
proving process

由题知
A ⇔ m i 1 ∨ m i 2 ∨ ⋯ ∨ m i k ⇔ M j 1 ∧ M j 2 ∧ ⋯ ∧ M j t \begin{aligned} A&\Leftrightarrow m_{i_1}\lor m_{i_2}\lor\cdots\lor m_{i_k}\\ &\Leftrightarrow M_{j_1}\land M_{j_2}\land\cdots\land M_{j_t} \end{aligned} Ami1mi2mikMj1Mj2Mjt
∴ ¬ A ⇔ ¬ M j 1 ∨ ¬ M j 2 ∨ ⋯ ∨ ¬ M j t ⇔ m j 1 ∨ m j 2 ∨ ⋯ ∨ m j t \therefore \lnot A\Leftrightarrow\lnot M_{j_1}\lor\lnot M_{j_2}\lor\cdots\lor\lnot M_{j_t}\Leftrightarrow m_{j_1}\lor m_{j_2}\lor\cdots\lor m_{j_t} ¬A¬Mj1¬Mj2¬Mjtmj1mj2mjt
∵ A ∨ ¬ A ⇔ T \because A\lor\lnot A\Leftrightarrow T A¬AT
∴ ( m i 1 ∨ m i 2 ∨ ⋯ ∨ m i k ) ∨ ( m j 1 ∨ m j 2 ∨ ⋯ ∨ m j t ) ⇔ T \therefore(m_{i_1}\lor m_{i_2}\lor\cdots\lor m_{i_k})\lor(m_{j_1}\lor m_{j_2}\lor\cdots\lor m_{j_t})\Leftrightarrow T (mi1mi2mik)(mj1mj2mjt)T
∵ \because 所有极小项的析取才为重言式
∴ { i 1 , i 2 , ⋯   , i k } ∪ { j 1 , j 2 , ⋯   , j t } = { 0 , 1 , ⋯   , 2 n − 1 } \therefore \{i_1,i_2,\cdots,i_k\}\cup\{j_1,j_2,\cdots,j_t\}=\{0,1,\cdots,2^n-1\} { i1,i2,,ik}{ j1,j2,,jt}={ 0,1,,2n1}
∵ A ∧ ¬ A ⇔ F \because A\land\lnot A\Leftrightarrow F A¬AF
∴   ( m i 1 ∨ m i 2 ∨ ⋯ ∨ m i k ) ∧ ( m j 1 ∨ m j 2 ∨ ⋯ ∨ m j t ) ⇔ ( m i 1 ∧ m j 1 ) ∨ ( m i 1 ∧ m j 2 ) ∨ ⋯ ∨ ( m i 1 ∧ m j t )      ∨ ( m i 2 ∧ m j 1 ) ∨ ( m i 2 ∧ m j 2 ) ∨ ⋯ ∨ ( m i 2 ∧ m j t )      ∨ ⋯ ∨ ( m i k ∧ m j 1 ) ∨ ( m i k ∧ m j 2 ) ∨ ⋯ ∨ ( m i k ∧ m j t ) ⇔ F \begin{aligned}\therefore\ &(m_{i_1}\lor m_{i_2}\lor\cdots\lor m_{i_k})\land(m_{j_1}\lor m_{j_2}\lor\cdots\lor m_{j_t})\\&\Leftrightarrow(m_{i_1}\land m_{j_1})\lor(m_{i_1}\land m_{j_2})\lor\cdots\lor(m_{i_1}\land m_{j_t})\\&~~~~\lor(m_{i_2}\land m_{j_1})\lor(m_{i_2}\land m_{j_2})\lor\cdots\lor(m_{i_2}\land m_{j_t})\\&~~~~\lor\cdots\lor(m_{i_k}\land m_{j_1})\lor(m_{i_k}\land m_{j_2})\lor\cdots\lor(m_{i_k}\land m_{j_t})\\&\Leftrightarrow F\end{aligned}  (mi1mi2mik)(mj1mj2mjt)(mi1mj1)(mi1mj2)(mi1mjt)    (mi2mj1)(mi2mj2)(mi2mjt)    (mikmj1)(mikmj2)(mikmjt)F
∴ m i a ∧ m j b ⇔ F \therefore m_{i_a}\land m_{j_b}\Leftrightarrow F miamjbF 其中 a ∈ { 1 , 2 ⋯ k } a\in\{1,2\cdots k\} a{ 1,2k} b ∈ { 1 , 2 , ⋯   , t } b\in\{1,2,\cdots,t\} b{ 1,2,,t}
∵ \because 不同极小项的合取为矛盾式
∴ i a ≠ j b \therefore i_a\neq j_b ia=jb
∴ { i 1 , i 2 , ⋯   , i k } ∩ { j 1 , j 2 , ⋯   , j t } = ∅ \therefore \{i_1,i_2,\cdots,i_k\}\cap\{j_1,j_2,\cdots,j_t\}=\varnothing { i1,i2,,ik}{ j1,j2,,jt}=

因此只要求出命题公式 A A A 的主析取范式和主合取范式二者之一,就可由此求出另一个
如:已知 P ↔ Q P\leftrightarrow Q PQ 的主合取范式为 ∏ ( 1 , 2 ) \prod(1,2) (1,2),则可知其主析取范式为 ∑ ( 0 , 3 ) \sum(0,3) (0,3)

命题逻辑的推理理论

推理

H 1 , H 2 , ⋯   , H n ,   C H_1,H_2,\cdots,H_n,\ C H1,H2,,Hn, C 是命题公式,若满足 H 1 ∧ H 2 ∧ ⋯ ∧ H n ⇒ C H_1\land H_2\land\cdots\land H_n\Rightarrow C H1H2HnC 则,

  • C C C前提 H 1 , H 2 , ⋯   , H n H_1,H_2,\cdots,H_n H1,H2,,Hn有效结论
    或称 C C C 可由前提 H 1 , H 2 , ⋯   , H n H_1,H_2,\cdots,H_n H1,H2,,Hn 逻辑推出
  • 称从前提 H 1 , H 2 , ⋯   , H n H_1,H_2,\cdots,H_n H1,H2,,Hn 推出结论 C C C 的过程为推理论证证明

为简化书写,也将 H 1 ∧ H 2 ∧ ⋯ ∧ H n ⇒ C H_1\land H_2\land\cdots\land H_n\Rightarrow C H1H2HnC 写作 H 1 , H 2 , ⋯   , H n ⇒ C H_1,H_2,\cdots,H_n\Rightarrow C H1,H2,,HnC

推理规则

公认规则

常见等价公式和蕴含公式

P 规则

推导过程中,前提可以在任何步骤引入

T 规则

推导过程中,由已知公式推出的结论可引入推导过程

推理方法

无义证明法

证明前提 P P P 为矛盾式,则有 P → Q P\rightarrow Q PQ 为重言式,即 P ⇒ Q P\Rightarrow Q PQ

平凡证明法

证明结论 Q Q Q is a tautology, then there isP → QP\rightarrow QPQ is a tautology, that is,P ⇒ QP\Rightarrow QPQ

direct proof method

Starting from premises, using inference rules and logical deduction to arrive at effective conclusions

Reductio ad absurdum (evidence by contradiction)

证明 H 1 ∧ H 2 ∧ ⋯ ∧ H n ∧ ¬ C H_1\land H_2\land\cdots\land H_n\land\lnot C H1H2Hn¬ C is a contradiction

CP Rules

For ( H 1 ∧ H 2 ∧ ⋯ ∧ H n ) ⇒ ( R → C ) (H_1\land H_2\land\cdots\land H_n)\Rightarrow(R\rightarrow C)(H1H2Hn)(RC ) Formal reasoning
can use an indirect method, that is, the antecedentRRR as an additional premise, prove
H 1 ∧ H 2 ∧ ⋯ ∧ H n ∧ R ⇒ C H_1\land H_2\land\cdots\land H_n\land R\Rightarrow CH1H2HnRC is certified

proving process

∵ H ⇒ ( R → C ) \because H\Rightarrow(R\rightarrow C) H(RC)
∴ H → ( R → C ) \therefore H\rightarrow(R\rightarrow C) H(RC ) is a tautology
∵ \because∵Output law:P → ( Q → R ) ⇔ ( P ∧ Q ) → RP\rightarrow(Q\rightarrow R)\Leftrightarrow(P\land Q)\rightarrow RP(QR)(PQ)R
∴ ( H ∧ R ) → C \therefore(H\land R)\rightarrow C (HR)C is also a tautology
∴ ( H ∧ R ) ⇒ C \therefore(H\land R)\Rightarrow C(HR)C

## Reference [1] Discrete Mathematics Xi'an University of Electronic Science and Technology Press Second Edition [2] [Proposition Changyuan Baidu Encyclopedia] (https://baike.baidu.com/item/%E5%91%BD%E9%A2 %98%E5%B8%B8%E5%85%83?fromModule=lemma_search-box) [3] [Proposition formula Baidu Encyclopedia](https://baike.baidu.com/item/%E5%91%BD% E9%A2%98%E5%85%AC%E5%BC%8F?fromModule=lemma_search-box)

Guess you like

Origin blog.csdn.net/qq_52554169/article/details/131709326