Chapter 1 - Logic and Proofs
离散数学的笔记对翁老师分享的前辈的笔记有所参考,所以放在前面,文章中讲的不详细的地方,大家可以去阅读学长的笔记
定义
注意
补充、解释
其他
术语对照
参考这就来了(
- conjunction 合取
- disconjunction 析取
- exclusive or 异或
- precedence 优先级
1 Propositional Logic
1.1 Proposition
A proposition is a declarative sentence that is either true or false,but not both.
- Beijing is the captial of China.
- He shouted, “Stop!”(光看这句话我们不知道真假,但是在那一刻地点那一时刻,他要么说了,要么没说,一定可以确定真假)
- x+1=2(这不是命题,因为我们无法判断真假,注意与上一个区别,上一个是我们不知道真假,但可以确定真假,譬如问一下在场的人,而这一个无法确定,因为我们不知道x的取值)
- Open the door.(祈使句,不是陈述句)
Anyway,it doesn’t matter.
Propositional Logic is the area of logic that deals with propositions.
- Propositional variables:
each represents a proposition like “Today is Friday.” - Truth value:T(if a proposition is true),F
- Logical operators(Connectives) :be used to form compound propositions from existing propositions
1.2 Logical Operators
- Negation
- Conjunction
(p和q都真才为真) - Disjunction
(p和q至少有一个为真即为真) - Exclusive OR
(p和q真值不同时为真)
1.2.1 Conditional Operator
Let
The conditional statement is false only when
Equivalent Forms
- If p,then q
- p implies q
- q if p
- q when p
- q whenever(every time that,每当,只要) p
- p is sufficient condition for q
- p only if q
(只有q为真时,p才能是真的,也就是说p can’t be true when q isn’t true,q为假时p为假(事实上,这个命题就只规定了这一件事),所以p为真q为假时这个命题为假;如果p是假的,那么q是真是假这个命题都是对的,因为这个命题只要求p是真的时,q必须是真的) - 让我们举个例子,我去上课only if我醒了,即只有我醒了,我才会去上课,但这并不说明我一定去上课了,其实就是在说我醒了是我去上课的必要条件,一定要我醒了,我才能去上课,而不是如果我醒了我就去上课(如果你因此更晕了,那就记住它或者忘掉我所说的orz)
unless (q是真的,除非p是假的,也就是p为真时q一定为真,p为假时这个命题一定正确,因为没说p是假的时对q有什么要求,而p是假的但q是真的时这个命题就是假的,因此它与implication等价)
Converse of Conditional Statement
二者不一定等价
Inverse of Conditional Statement
二者不一定等价
Contrapositive of Conditional Statement
二者等价
When two compound propositions always have the same truth value in all possible cases we call them equivalent
1.2.2 Biconditional Operator
即
p和q同时为真或同时为假时,
如果
注意一定要求是永真式,如果说:如果
例如,p:今年是2026年,q:我今天喝了水
那么在2026年,有一天我喝了水,那么那一天
如果你还是很晕,那么记住下面这点:
我们说复合命题p和复合命题q等价,只是在陈述“p和q的真值一定一样”或“
另一方面,
1.2.3 Precedence of Logical Operators
| Operator | Precedence |
|---|---|
| 1 | |
| 2 | |
| 3 |
1.3 Translation
You can access the Internet from campus only if you are a computer science major or you are not a freshman.
Let
a:”you can access the Internet from campus”
c:”you are a cs major”
f:”you are a freshman”
1.4 Consistent System Specifications
A list of propositions is consistent if it is possible to assign truth values to the proposition variables so that each proposition is true.
2 Propositional Equivalences
2.1 Classification of Compound Propositions
- Tautology:compound proposition that is always true
- Contradiction:compound proposition that is always false
- Contingency neither a tautology nor a contradiction
For example,is a tautology
2.2 Logical Equivalences
The compound propositions
Notation:
| Name | Equivalence |
|---|---|
| Identity laws | |
| Domination laws | |
| Idempotent laws(幂等律) | |
| Commutative laws | |
| Associative laws | |
| Distributive laws | |
| De Morgan’s laws | |
| Absorption laws | |
| Implication law | |
| Equivalence law |
2.3 Propositional Satisfiability
A compound proposition is satisfiable if there is an assignment of truth values to its variables that make it true.When no such assignments exist,the compound proposition is unsatisfiable.
3 Predicates and Quantifiers
3.1 Predicate
A predicate (propositional function) is a statement that contains variables.Once the values of the variables are specified,the function has a truth value.
” ”,and is false ” is the ’s best friend”
3.2 Quantifiers
Predicate Logic:the area of logic that deals with predicate and quantifiers.
3.2.1 Universal Quantification
A universal quantification of
Domain:range of the possible values of the variable x
An element for which P(x) is false is called a counterexample(反例) of
The truth value of
is false if the domain consists of all real numbers. Express the following statement as a universal quantification:
“All lions are fierce.”
Let Q(x) denote the statement “x is fierce.”
(1) Assuming that the domain is the set of all lions.
(2) Assuming that the domain is the set of all creatures.
P(x): “x is a lion.”
3.2.2 Existential Quantification
An existential quantification of P(x),denoted by
Express the following statement as an existential quantification.
“Some real numbers are rational numbers.”
Let Q(y): y is a rational number
(1) Assuming that the domain is the set of all real numbers.
(2) Assuming that the domain is the set of all complex numbers.Let R(y): y is a real number
存在唯一:
3.2.3 Quantifiers with Restricted Domains
Domain: the real numbers
It’s logically equivalent to
3.2.4 Precedence of Quantifiers
The quantifiers have higher precedence than all logical operators from propositional calculus.
3.2.5 Binding Variables
When a quantifier is used on the variable x,we say that this occurence of the variable is bound(受约束的).
A variable neither quantified nor specified with a value is said to be free.
All the variables in a propositional function must be quantified or set equal to a particular value to turn it into a proposition.
例如
(一般默认x和y的取值范围是一样的,不清楚,问了几个ai这么说的)
Scope of a quantifier:the part of a logical expression to which the quantifier is applied.
3.3 Logical Equivalences Involving Quantifiers
Statements involving predicates and quantifiers are logically equivalent iff they have the same truth value for every predicate substituted into these statements and for every domain of discourse used for the variables iin the expressions.
x is not occurring in A
| Equivalence | Proof |
|---|---|
| 分A为T或F两种情况证明 | |
| 上式任意或存在选一个,与变成或或者或变成与,四种情况都成立 | |
| 上式任意变成存在仍成立 | |
| 先去掉箭头,再利用第三行 | |
| 上式任意、存在互换仍成立 |
3.4 Translation
All lions are fierce.
Some lions do not drink coffee.
P(x):x is a lion
Q(x):x is fierce
R(x):x drinks coffee
Assume the domain consists of all creatures.
(1)
(2)
注意不能是
同理(1)中不能用与,那样就变成所有的生物都是狮子而且很凶狠
3.5 Nested Quantifiers
Two quantifiers are nested if one is within the scope of the other.
这里
也可以理解成
Everyone has exactly one best friend.
Domain:All people
B(x,y): “y is the best friend of x.”
注意x后的括号要一直括到最后,否则B(x,z)里的x就没被量词作用,也没赋值,就不是命题
同理y,z右侧的括号也要括到最后
也可以写成嵌套量词
过程是先遍历论域中的x,对每一个x要找到一个y满足:遍历论域中的z,
3.5.1 The Order of Quantifiers
The order of nested quantifiers matters if quantifiers are of different types.
论域:实数
存在一个x,使得对所有y,x+y=1,这是假命题
对任意y,都存在一个x使得x+y=1,这是真命题
3.5.2 Negating Nested Quantifiers
Successively apply the rules for negating statements involving a single quantifier.
这时这样理解的好处就凸显了
例如
等价于
等价于
等价于
4 Functionally Complete
A set of logical operators is called functionally complete if every compound proposition is logically equivalent to a compound proposition involving only this set of logical operators.
比如与、或、非构成的逻辑操作符集合就是functionally complete的
与非也可以(跟数逻联动了)
5 Propositional Normal Forms
Literal(字面量):
Disjunctions (conjunctions) with one or more literals as disjuncts (conjuncts) are called disjunctive (conjunctive) clauses.
例如
5.1 Normal Forms(CNF&DNF)
A conjunction with one or more disjunctive clauses is said to be in conjunctive normal form.
A disjunction with one or more conjunctive clauses is said to be in disjunctive normal form.
例如
5.2 How to Obtain Normal Forms
- 利用
和 和 去掉箭头 - 德摩根律去掉非
- 利用分配律统一符号
- Title: Chapter 1 - Logic and Proofs
- Author: Hare Fuyukawa
- Created at : 2026-03-13 17:45:21
- Updated at : 2026-03-25 18:22:25
- Link: https://redefine.ohevan.com/Discrete-Mathematics/DM/DM-1/
- License: This work is licensed under CC BY-NC-SA 4.0.