Chap1 Propositional Logic HT 2
Chap1 Propositional Logic HT 2
&
APPLICATIONS
1
Chapter 1: Propositional Logic
2
1.1
Propositional Logic
3
DEFINITION
(4) 𝑥 + 2 > 0.
Convention. If a proposition 𝑝 is true then we say that its truth value is true (denoted by 𝑇).
Otherwise, we will say that the truth value of 𝑝 is false (denoted by 𝐹).
4
COMPOUND PROPOSITIONS
Definition. Let 𝑝 be a proposition.
(1) The negation of 𝑝:
5
COMPOUND PROPOSITIONS
Let 𝑝 and 𝑞 be two propositions.
(2) The conjunction of 𝑝 and 𝑞:
𝑝 ∧ 𝑞 = "𝑝 and 𝑞" = proposition that is true when both 𝑝 and 𝑞 are true, and is false otherwise.
Example. Let 𝑝 = "She is very naughty", 𝑞 = "She is not obstinate".
6
COMPOUND PROPOSITIONS (cont.)
𝑝 ∨ 𝑞 = "𝑝 or 𝑞"= proposition that is false when both 𝑝 and 𝑞 are false, and is true otherwise.
Example. 𝑝 = "Students who have missed more than 6 slots can not pass this class".
𝑞 = "Students who have not taken any progress test can not pass this class".
𝑝 ∨ 𝑞 = "Students who have not taken any progress or have missed more than 6 slots can not pass this class.
7
COMPOUND PROPOSITIONS (cont.)
Let 𝑝 and 𝑞 be two propositions.
(4) The exclusive or of 𝑝 and 𝑞:
𝑝 ⊕ 𝑞 = "only 𝑝 or only 𝑞" = proposition that is true when exactly one of 𝑝 and 𝑞 is true, and is false
otherwise.
Example. 𝑝 = "You can adopt a cat".
𝑞 = "You can adopt a hamster".
𝑝 ⊕ 𝑞 = "You can adopt a cat or a hamster, but not both".
8
COMPOUND PROPOSITIONS (cont.)
Let 𝑝 and 𝑞 be two propositions.
𝑝 ⟶ 𝑞 = "if 𝑝 then 𝑞" = proposition that is false when 𝑝 is true and 𝑞 is false, and is true
otherwise.
9
COMPOUND PROPOSITIONS (cont.)
Let 𝑝 and 𝑞 be two propositions.
𝑝 ⟷ 𝑞 = proposition that is true when 𝑝 and 𝑞 have the same truth value, and is false otherwise.
10
SUMMARY
Remark. A bit is a symbol taking two values, 0 and 1. A bit can represent the truth value of a
proposition:
1 = 𝑇𝑟𝑢𝑒 and 0 = 𝐹𝑎𝑙𝑠𝑒.
11
LOGICAL EXPRESSIONS
Example. Translate the following propositions into logical expressions.
(1) When I am over 25, I will marry her.
Put 𝑝 = "I am over 25 years old",
𝑞 = "I marry her".
Then logical expression of (1) is 𝑝 ⟶ 𝑞.
12
1.2
Propositional Equivalences
13
LOGICAL EQUIVALENCES
Definition. (1) A compound proposition that is always true, no matter what the truth values of
propositions that occur in it, is called a tautology.
(2) A compound proposition that is always false is called a contradiction.
(3) A compound proposition that is neither a tautology nor a contradiction is called a contigency.
14
SOME BASIC LOGICAL EQUIVALENCES
15
LOGICAL EQUIVALENCES - TRUTH TABLE METHOD
In practice, one can verify logical equivalences using truth tables.
16
PRACTICE
Verify the following logical equivalences.
(a) 𝑝 ⟶ 𝑞 ≡ ¬𝑝 ∨ 𝑞 ≡ (¬𝑞) ⟶ (¬𝑝).
(b) 𝑝 ⟷ 𝑞 ≡ 𝑝⟶𝑞 ∧ 𝑞⟶𝑝 .
(c) ¬(𝑝 ⊕ 𝑞) ≡ (¬𝑝 ∨ 𝑞) ∧ (𝑝 ∨ ¬𝑞).
(d) 𝑝 ⊕ 𝑞 ≡ ¬ 𝑝 ⟷ 𝑞 .
(e) ¬ 𝑝 ⟶ 𝑞 ≡ 𝑝 ∧ ¬𝑞.
17
1.3
Predicates and Quantifiers
18
PREDICATE
Example. Consider 𝑃 𝑥 = "𝑥 > 3". For specified values of 𝑥, then it becomes a proposition. For
instance, 𝑃 1 = 𝐹𝑎𝑙𝑠𝑒 and 𝑃 4 = 𝑇𝑟𝑢𝑒.
Remark. In 𝑃 𝑥 , the symbol "𝑥" is called variable and the part " > 3" is called predicate.
19
QUANTIFIERS: ∀, ∃
Let 𝑃(𝑥) be a propositional function.
∎ Universal quantification:
∀𝑥𝑃 𝑥 = "For all values of 𝑥, 𝑃(𝑥) is true".
∎ Existential quantification:
∃𝑥𝑃(𝑥) = "There is at least a value of 𝑥 such that 𝑃(𝑥) is true".
20
LOGICAL EXPRESSIONS WITH QUANTIFIERS
Example. For each of the following statements, find a logical expression using quantifiers and
propositional functions.
(1) "Every prime number is not divisible by 2".
21
(2) "Some student in HT’s class has visited Thach That district".
Solution. First, introduce a variable 𝑥:
"There is a student 𝑥 in HT’s class with the property that 𝑥 has visited Thach That district".
Next, put 𝑃 𝑥 = "𝑥 has visited Thach That district".
With the domain 𝐷 = {students in HT’s class}, we find the logical expression
∃𝑥𝑃 𝑥 .
(3) "Every student of FPT University has visited Thach That and Quoc Oai".
Solution.
22
1.4
Nested Quantifiers
23
NESTED QUANTIFIERS
Exercise. Translate the following statements into English, where the domain of variables is ℝ.
a) ∀𝑥∃𝑦𝑃 𝑥, 𝑦 where 𝑃 𝑥, 𝑦 = "𝑥 < 𝑦".
b) ∃𝑥∀𝑦𝑄 𝑥, 𝑦 where 𝑄 𝑥, 𝑦 = "𝑥 + 𝑦 ≥ 𝑦".
c) ∀𝑥∀𝑦𝑅 𝑥, 𝑦 where 𝑅 𝑥, 𝑦 = "[(𝑥 ≥ 0) ∧ (𝑦 ≥ 0)] ⟶ (𝑥𝑦 ≥ 0)".
24
LOGICAL EXPRESSIONS WITH NESTED QUANTIFIERS
Examples. For each of the following statements, find a logical expression using quantifiers and
propositional functions.
(1) "Some student of FPT University gave flowers to all female students".
25
(2) "If a person is female and is a parent, then this person is someone’s mother".
Solution. First, introduce two variables 𝑥 and 𝑦:
"For every person 𝑥, if 𝑥 is female and 𝑥 is a parent, then there is a person 𝑦 such that 𝑥 is the
mother of 𝑦".
Next, put 𝑃 𝑥, 𝑦 = "𝑥 is the mother of 𝑦", 𝑄 𝑥 = "𝑥 is female"
and 𝑅 𝑥 = "𝑥 is a parent".
With the domain 𝐷 = {all people}, we find the logical expression
∀𝑥∃𝑦 𝑄 𝑥 ∧ 𝑅 𝑥 ⟶ 𝑃 𝑥, 𝑦 .
26
NEGATING NESTED QUANTIFIERS
(1) ¬ ∀𝑥𝑃 𝑥 ≡ ∃𝑥¬𝑃(𝑥). (2) ¬ ∃𝑥𝑃 𝑥 ≡ ∀𝑥¬𝑃(𝑥).
27
1.5
Rules of Inference
28
AN EXAMPLE
Example. Suppose we have an argument:
"If you have one million dollars, then you can buy a villa".
Put 𝑝 = "You have one million dollars" and 𝑞 = "You can buy a villa".
How do we deduce that 𝑞 is true provided 𝑝 is true?
Observe that 𝑝 ∧ 𝑝 ⟶ 𝑞 ⟶ 𝑞 is a tautology.
Now, since both 𝑝 and 𝑝 ⟶ 𝑞 are true, it implies that 𝑞 must be true also.
29
DEFINITIONS
30
TABLE: RULES OF INFERENCES
31
Example. Show that the following premises
"If you send me an email, then I will finish writing the program",
"If you do not send me an email, then I will go to sleep early",
"If I go to sleep early, then I will wake up feeling refreshed"
together lead to the conclusion
"If I do not finish writing the program, then I will wake up feeling refreshed".
Solution. Put 𝑝1 = "You send me an email", 𝑝2 = "I will finish writing the program",
𝑝3 = "I will go to sleep early", 𝑝4 = "I will wake up feeling refreshed".
𝑞 = (¬𝑝2 ⟶ 𝑝4 ).
32
TABLE: RULES OF INFERENCES FOR QUANTIFIED STATEMENTS
33
EXAMPLE
Example. Show that the following premises
𝑝1 = "Everyone in this class has taken a course in computer science",
𝑝2 = "Jillian is a student in this class"
together lead to the conclusion "Jillian has taken a course in computer science".
34
PRACTICE
35
PRACTICE
36
PRACTICE
37
PRACTICE
38
PRACTICE
39
PRACTICE
40
PRACTICE
41
PRACTICE
42
PRACTICE
43
PRACTICE
44
45
46
47
48
49
50
51