1. Logic
1. Logic
Mathematical
Logic
CALCULUS I
HELENA ALMEIDA, JOÃO FARINHA, PATRÍCIA XUFRE, PEDRO CHAVES
2
CALCULUS 1
Agenda
1. Definition of Proposition.
2. Logical Connectives and Truth Tables.
3. Quantifiers.
3
CALCULUS 1
1. Definition of proposition
A proposition is a statement that is, by itself, either true (T) or False (F).
4
CALCULUS 1
Examples of propostions:
5
CALCULUS 1
6
CALCULUS 1
𝒑∧𝒒
2.1 Conjunction of 𝒑 and 𝒒 (write 𝒑 ∧ 𝒒, read 𝒑 AND 𝒒)
What is the truth value of the compound statement 𝒑 ∧ 𝒒 ?
Truth table
7
CALCULUS 1
𝒑∨𝒒
2.2 Disjunction of 𝒑 and 𝒒
We write 𝑝 ∨ 𝑞 . We read 𝑝 OR 𝑞 .
8
CALCULUS 1
Quiz
Click the Quiz button to edit this object
8
CALCULUS 1
𝒑⇒𝒒
2.3 Implication (if 𝒑, then 𝒒 )
10
CALCULUS 1
𝒑: ”It is raining.”
Example:
𝒒: ”I carry an umbrella.” PROMISE
10
CALCULUS 1
𝒑 ⇒ 𝒒 is true 𝒑 ⇒ 𝒒 is false
11
CALCULUS 1
12
CALCULUS 1
𝒑⇔𝒒
2.4 Equivalence between 𝒑 and 𝒒
𝑝⇔𝑞 ⇔ 𝑝⇒𝑞∧𝑞 ⇒𝑝
13
CALCULUS 1
Example:
𝒑⇔𝒒
14
CALCULUS 1
15
CALCULUS 1
𝑝: “9 is a multiple of 3”.
𝑞 : “Portugal belongs to the EU”.
16
CALCULUS 1
17
CALCULUS 1
~𝒑
2.5 Negation of 𝒑
It is the opposite of proposition 𝑝 and is represented by ~𝑝 (read “not p”),
sometimes represented by ¬𝑝.
~ ~𝑝 ⇔ 𝑝
18
CALCULUS 1
Examples:
𝒑: “𝑒 0 is an irrational number”
~𝒑: “𝑒 0 is NOT an irrational number”
𝒒: “𝑥 > 0”
~𝒒: “𝑥 ≤ 0”
19
CALCULUS 1
~ 𝒑∧𝒒
2.5.1 Negation of a conjunction
~ 𝒑 ∧ 𝒒 ⇔ ~𝒑 ∨ ~𝒒
20
CALCULUS 1
Example:
𝒑: ” Next year I will visit Japan”
𝒒: ” Next year I will visit Australia”
𝒑 ∧ 𝒒: ” Next year I will visit Japan and Australia”
or or
21
CALCULUS 1
~ 𝒑∨𝒒
2.5.2 Negation of a disjunction
~ 𝒑 ∨ 𝒒 ⇔ ~𝒑 ∧ ~𝒒
22
CALCULUS 1
Example:
𝒑: ” Next year I will visit Japan”
𝒒: ” Next year I will visit Australia”
𝒑 ∨ 𝒒: ” Next year I will visit Japan or Australia”
23
CALCULUS 1
~ 𝒑⇒𝒒
2.5.3 Negation of an implication
~ 𝑝⇒𝑞 ⇔𝑞⇒𝑝
Common
mistakes! ~ 𝑝 ⇒ 𝑞 ⇔ ~𝑝 ⇒ ~𝑞
~ 𝑝 ⇒ 𝑞 ⇔ ~𝑞 ⇒ ~𝑝
~ 𝒑 ⇒ 𝒒 ⇔ 𝒑 ∧ ~𝒒
24
CALCULUS 1
𝒑: ”It is raining.”
𝒒: ”I carry na umbrella.”
𝒑 ⇒ 𝒒: ”If it is raining, (then) I will carry an umbrella”
~ 𝒑 ⇒ 𝒒 ⇔ 𝒑 ∧ ~𝒒
Negate that “if it rains, I will carry an umbrella”, is equivalent to
stating that “it is raining, and I am not carrying an umbrella”!!
25
CALCULUS 1
~ 𝒑⇔𝒒
⇔~ 𝑝⇒𝑞∧𝑞 ⇒𝑝
⇔~ 𝑝 ⇒𝑞 ∨~ 𝑞 ⇒𝑝
⇔ 𝑝 ∧ ~𝑞 ∨ 𝑞 ∧ ~𝑝
26
CALCULUS 1
Useful equivalences…
Contrapositive
𝒑 ⇒ 𝒒 ⇔ ~𝒒 ⇒ ~𝒑
𝒑 ⇒ 𝒒 ⇔ 𝒒 ∨ ~𝒑
27
CALCULUS 1
28
CALCULUS 1
29
CALCULUS 1 Quiz
Click the Quiz button to edit this object
30
CALCULUS 1
3. Quantifiers
∃ is the existential quantifier. We read “there is” or “there is at least one”.
∃𝑥 ∈ 𝐷 ∶ 𝑝(𝑥)
31
CALCULUS 1
Examples
∃𝒙 ∈ ℝ: −𝒙 = −𝟏
− 𝟒
∃𝒙 ∈ ℤ : 𝒙 = 𝟏𝟔
32
CALCULUS 1
3. Quantifiers
∀ is the universal quantifier. We read “for all” or “for every”.
∀𝑥 ∈ 𝐷: 𝑝(𝑥)
33
CALCULUS 1
Examples
∀𝒙 ∈ ℝ− 𝒙 = −𝒙
∀𝒙 ∈ ℕ 𝒙 < 𝟔
34
CALCULUS 1
Order of quantifiers
Order matters when using both existential and universal
quantifiers! Let us look at the cases below.
35
CALCULUS 1
~ ∀𝑥 ∈ 𝐷, 𝑝(𝑥) ⇔ ∃𝑥 ∈ 𝐷: ~ 𝑝(𝑥)
B : ”In every mall the most visited area is the restauration area.”
~B : ”There is (at least one) mall where the most visited are is
NOT the restauration area.”
36
CALCULUS 1
~𝑪 : ” There was (at least) one semester when every student had a
final grade not higher than 17”
37
CALCULUS 1
38