Ch02 Prop Logic Raw
Ch02 Prop Logic Raw
Mark Aagaard
[email protected]
2025-Winter
Chapter 2 Propositional Logic 2.1 Introduction
2.1 Introduction
2.2 Syntax and Semantics
2.2.1 Syntax
2.2.2 Evaluation
2.2.3 Tautologies, Satisfiable, and Contradictions
2.2.4 Counterexample
2.2.5 Weaker, Equal, Stronger, Incomparable
2.3 Formalizing Natural Language
2.3.1 Overview
2.3.2 Rules for Formalization
2.3.3 Translating Logic into English
2.3.4 Problematic Sentences
2.3.5 Potentially Confusing
2.3.6 Ambiguities
2.3.7 Requirements and Recommendations
2.4 Proofs
2.4.1 Elimination Rules
2.4.2 Finishing a Proof
2.4.3 Introduction Rules
2.5 Index
Copyright © Mark Aagaard 2024–2025 2 / 102
Chapter 2 Propositional Logic 2.1 Introduction
2.1 Introduction
Motivation
2.2.1 Syntax
▶ two constants: True and False
Note: When working on paper/tablet, you may abbreviate
with T and F. In Lean4, you must use True and False.
Note: Do not use T , F , t, or f in any font as variables
because it is easy to confuse them with True and False!
▶ atomic propositions a, b , c, d , e, . . . , p, q, r, . . .
▶ propositional operators
Informal Formal
Symbol name name
¬ not negation
∧ and conjunction
∨ or disjunction
⊕ xor exclusive or
⇒ implication
⇔ if-and-only-if
▶ parentheses (. . .)
Copyright © Mark Aagaard 2024–2025 6 / 102
Chapter 2 Propositional Logic 2.2 Syntax and Semantics 2.2.1 Syntax
Examples
Examples of propositions:
Formula English
p ⇒q “p implies q”
(p ∧ q) ⇒ r “p and q implies r”
Well-Formed Formulas
¬ P ∧ ¬ Q ∨ R ∨ S
Example 2.2:
P ⇒ Q ∧ R ∨ X ⇔ Y ∨ R
Example 2.3:
¬P ⇒Q ∧ R ⇒ S
Terminology
In implication, as in P ⇒ Q :
▶ P is the premise or antecedent or hypothesis
▶ Q is the consequent or conclusion
2.2.2 Evaluation
ments.
▶ These figures show in which {p=T,q=T}
environments an expression
evaluates to true. All environments for p and q
{p=F,q=F} {p=F,q=F}
{p=T,q=T} {p=T,q=T}
p q
Copyright © Mark Aagaard 2024–2025 13 / 102
Chapter 2 Propositional Logic 2.2 Syntax and Semantics 2.2.2 Evaluation
{p=T,q=T}
{p=T,q=T}
p ∧q p ∨q
{p=F,q=F} {p=F,q=F}
{p=F,q=T} {p=T,q=F}
{p=F,q=T} {p=T,q=F}
{p=T,q=T}
{p=T,q=T}
p ⇒q (p ∧ q) ⇒ q
Copyright © Mark Aagaard 2024–2025 14 / 102
Chapter 2 Propositional Logic 2.2 Syntax and Semantics 2.2.2 Evaluation
Truth Tables
▶ Venn diagrams
▶ Good for intuition of simple formulas
▶ Tedious to draw
▶ Truth tables
▶ A more efficient technique to evaluate formulas in sets of
environments
▶ Each row represents one environment.
▶ Each column represents one variable or sub-formula
Example 2.5: Use a truth table to evaluate p ∧ q ⇒ q in all
possible environments.
Satisfying Assignment
2.2.4 Counterexample
Example: Counterexample
▶ My favourite logician
wears red or is modern.
▶ My favourite logician
wears red and is modern.
Definition 2.1:
P is stronger than Q := (P ⇒ Q ) ∧ ¬(Q ⇒ P )
P is weaker than Q := (Q ⇒ P ) ∧ ¬(P ⇒ Q )
P is equal to Q := P ⇔Q
P is incomparable to Q := ¬(P ⇒ Q ) ∧ ¬(Q ⇒ P )
Example 2.9:
In each diagram, answer whether P is weaker, equal, stronger, or
incomparable to to Q .
Q P
P Q
P Q P Q
Example 2.10: For the pair of formulas below, is the first formula
weaker, equal, stronger, or incomparable to the second formula?
p ⇔ q and p
Solution (cont’d)
Solution (cont’d)
Example 2.11: For the pair formulas below, is the first formula
weaker, equal, stronger, or incomparable to the second formula?
p ⇔ q and p ⇒ q
3 8
Checking Credentials
Name of instructor Prof Mano Prof Nin Prof Ohrling Prof Pach
Course ECE-101 BIO-499 ??? ???
Engineer? ??? ??? No Yes
2.3.1 Overview
Motivation
Atomic Propositions
Example: Formalization
Examples
Operator Possible interpretations in English
¬P not P it is not the case that P
P ∧Q P and Q P but Q P while Q
P ∨Q P or Q P and/or Q P unless Q
P ⊕Q either P or Q
P ⇒Q if P then Q Q if P P only if Q
P implies Q Q when P P only when Q
P is sufficient for Q
Q is necessary for P
P ⇔Q P iff Q P if and only if Q
P exactly if Q P is equivalent to Q
P is necessary and sufficient for Q
“If”
“If” (cont’d)
Only and If
Confusing: Disjunction
Confusing: Implication
Example 2.25:
▶ Sentence: If an animal moos then it is a cow.
Which of these satisfy the sentence?
Confusing: Implication
Example 2.26: Formalize the sentence “If you do not behave
then I will take the toy away.”
Confusing: Unless
Example 2.29:
▶ Sentence: “It rains unless I take an umbrella”
▶ In the scenario where it rains and I take an umbrella, is the
sentence true or false?
Example 2.31:
▶ If the car’s current speed is greater than the cruise control
selected speed or the car is too close to the car in front
and the cruise control is on, then the cruise control system
should reduce the car’s speed.
▶ If the cruise control system is on and the car’s current speed
is greater than the cruise control selected speed or the car
is too close to the car in front and the cruise, then the cruise
control system should reduce the car’s speed.
2.3.6 Ambiguities
Ambiguity: Pronouns
Ambiguity: Pronouns
Example 2.34:
Find three meanings for “The Mi’kmaq can fish for a week.”
(The Mi’kmaq are a First Nations people of Canada.)
NOTE: “you” actually means: you, your customer, your manager, etc..
2.4 Proofs
Proof Structure
1 actually, a tree
Copyright © Mark Aagaard 2024–2025 71 / 102
Chapter 2 Propositional Logic 2.4 Proofs
Proof Rules
Recall:
▶ Each proof step applies a proof rule to an assumption or the goal.
▶ Apply a proof rule to:
▶ an assumption: creates a new assumption.
(All of the existing assumptions remain unchanged.)
▶ the goal,
▶ replace the current goal with the new goal(s)2
▶ and sometimes create a new assumption
⊢ P ⇒Q
By ImplElim Goal
1 P
⊢ Q
Intuition:
▶ The goal says that if P is true, then Q is true.
▶ We only need to show that Q is true in scenarios where P is true.
▶ To prove that P implies Q , it is sufficient to assume that P is true
and prove that Q is true.
▶ We assume that P is true and then prove that Q is true.
1 P ⇒Q
⊢ R
By ImplElim Asm 1
⊢ P
1 P ∧Q
By AndElim Asm 1
2 P
3 Q
2.4.1.3 Or Elimination
Or Elimination on Goal
⊢ P ∨Q ⊢ P ∨Q
By OrElimLeft Goal By OrElimRight Goal
1 P 1 Q
Or Elimination on Assumption
This proof rule generates two subproofs that we must complete.
1 P ∨Q
⊢ R
By OrElim Asm 1
Sub proof 1. Add P as asm
1.1 P
⊢ R
Example of Or Elim
Prove: (P ∨ Q ) ⇒ (Q ∨ P )
1 P ∨Q
⊢ Q ∨P
By OrElim Asm 1
1.1 P 2.1 Q
⊢ Q ∨P ⊢ Q ∨P
By OrElimRight Goal By OrElimLeft Goal
⊢ P ⊢ Q
QED Asm 1.1 QED Asm 2.1
⊢ ¬P
By NotElim Goal
1 P
⊢ False
2.4.2.1 Assumption
1 P
⊢ P
QED Asm 1
2.4.2.2 Contradiction
1 F
⊢ P
QED Contradiction Asm 1
1 P
2 ¬P
⊢ Q
QED Contradiction Asm 1, Asm 2
⊢ True
QED Logic
Copyright © Mark Aagaard 2024–2025 This material will not be tested 92 / 102
Chapter 2 Propositional Logic 2.4 Proofs 2.4.3 Introduction Rules
1 P
2 Q
By AndIntro Asm 1, Asm 2
3 P ∧Q
Copyright © Mark Aagaard 2024–2025 This material will not be tested 93 / 102
Chapter 2 Propositional Logic 2.4 Proofs 2.4.3 Introduction Rules
1 P
2 Q
3 P ∧Q ⇒ R
⊢ R
By AndIntro Asm 1, Asm 2
4 P ∧Q
By ImplElim Asm 3 Using Asm 4
5 R
⊢ R
QED Asm 5
Copyright © Mark Aagaard 2024–2025 This material will not be tested 94 / 102
Chapter 2 Propositional Logic 2.4 Proofs 2.4.3 Introduction Rules
⊢ P
By AndIntro Goal Using Q
⊢ P ∧Q
Copyright © Mark Aagaard 2024–2025 This material will not be tested 95 / 102
Chapter 2 Propositional Logic 2.4 Proofs 2.4.3 Introduction Rules
Or Introduction on Assumption
1 P
By OrIntro Asm 1 Using Q
2 P ∨Q
Copyright © Mark Aagaard 2024–2025 This material will not be tested 96 / 102
Chapter 2 Propositional Logic 2.4 Proofs 2.4.3 Introduction Rules
Or Introduction on Goal
Bad
⊢ P
By OrIntro Goal Using True
⊢ P ∨ True
By OrElimRight Goal
⊢ True
QED Logic
Copyright © Mark Aagaard 2024–2025 This material will not be tested 97 / 102
Chapter 2 Propositional Logic 2.4 Proofs 2.4.3 Introduction Rules
1 P
⊢ Q
By ImplIntro Goal Using Asm 1
⊢ P ⇒Q
Copyright © Mark Aagaard 2024–2025 This material will not be tested 98 / 102
Chapter 2 Propositional Logic 2.4 Proofs 2.4.3 Introduction Rules
1 P
2 Q
By ImplIntro Asm 2 Using Asm 1
3 P ⇒Q
Copyright © Mark Aagaard 2024–2025 This material will not be tested 99 / 102
Chapter 2 Propositional Logic 2.4 Proofs 2.4.3 Introduction Rules
1 P
⊢ False
By NotIntro Goal Using Asm 1
⊢ ¬P
Copyright © Mark Aagaard 2024–2025 This material will not be tested 100 / 102
Chapter 2 Propositional Logic 2.4 Proofs 2.4.3 Introduction Rules
Copyright © Mark Aagaard 2024–2025 This material will not be tested 101 / 102
Chapter 2 Propositional Logic 2.5 Index
2.1 Introduction
2.2 Syntax and Semantics
2.2.1 Syntax
2.2.2 Evaluation
2.2.3 Tautologies, Satisfiable, and Contradictions
2.2.4 Counterexample
2.2.5 Weaker, Equal, Stronger, Incomparable
2.3 Formalizing Natural Language
2.3.1 Overview
2.3.2 Rules for Formalization
2.3.3 Translating Logic into English
2.3.4 Problematic Sentences
2.3.5 Potentially Confusing
2.3.6 Ambiguities
2.3.7 Requirements and Recommendations
2.4 Proofs
2.4.1 Elimination Rules
2.4.2 Finishing a Proof
2.4.3 Introduction Rules
2.5 Index
Copyright © Mark Aagaard 2024–2025 102 / 102
Chapter 2 Propositional Logic 2.5 Index
A ▶ consequent 11
▶ ambiguous 50 ▶ Contradiction 90
▶ And elim on asm 82 ▶ contradiction 16
▶ counter example 19
▶ And elim on goal 83
▶ And intro on asm 93 D
▶ And intro on goal 95 ▶ declarative 34
▶ antecedent 11 ▶ disjuncts 11
▶ assumption 71 E
▶ atomic propositions 6, 8 ▶ elimination 75
▶ environment 12
C
▶ equal 23
▶ clause 34
▶ evaluate 12
▶ compound propositions 8
▶ conclusion 11 F
▶ formalize 33
▶ confusing 50
▶ conjuncts 11
opyright © Mark Aa-
G
102 / 102
Chapter 2 Propositional Logic 2.5 Index
I P
▶ Implication elimin on asm 77 ▶ premise 11
▶ Implication elimin on goal 76 ▶ proof 71
▶ Implies intro on asm 99 ▶ proof rule 71
▶ Implies intro on goal 98 ▶ proof step 71
▶ incomparable 23
▶ proof, done 72
▶ introduction rule 92
▶ ▶ propositional operators 6
irregular 50
N Q
▶ Not elimin on goal 87 ▶ Qed with asm 89
▶ Not intro on goal 100 ▶ Qed with goal 91
▶ satisfiable 16 ▶ tautology 16
▶ satisfying assignment 18
▶ semantics 5 V
▶ shall 69 ▶ variables 8
▶ shall not 69
▶ should 69 W
▶ stronger 23 ▶ weaker 23
▶ syntax 5 ▶ well-formed formulas (wff) 8
T ▶ wff 5