Propositional Logic
1269 words
6 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# Propositional Logic ## ๐ฏ Learning Objectives - Identify propositions and their truth values - Use logical connectives: $\land$, $\lor$, $\neg$, $\to$, $\leftrightarrow$ - Construct and interpret truth tables - Determine tautologies, contradictions, and contingencies - Prove logical equivalence using truth tables...

Propositional Logic
๐ฏ Learning Objectives
- Identify propositions and their truth values
- Use logical connectives: โง, โจ, ยฌ, โ, โ
- Construct and interpret truth tables
- Determine tautologies, contradictions, and contingencies
- Prove logical equivalence using truth tables and algebraic manipulation
1.1 Intuition: The Language of Mathematical Reasoning
Logic is the grammar of mathematics. Just as grammar rules tell us which sentences are well-formed, logic rules tell us which arguments are valid. Propositional logic is the simplest form โ it deals with whole statements that are either true or false.
๐ Key Insight: The truth of a compound statement depends ONLY on the truth values of its parts, not on their meaning.
1.2 Propositions
A proposition (or statement) is a declarative sentence that is either true or false โ but not both.
| Example | Proposition? | Truth Value |
|---|---|---|
| "The sky is blue." | Yes | True |
| "2 + 2 = 5." | Yes | False |
| "Please sit down." | No (imperative) | โ |
| "This statement is false." | No (paradox) | โ |
| " x>5 " | No (open sentence) | Depends on x |
Atomic vs. Compound Propositions
| Type | Definition | Example |
|---|---|---|
| Atomic | Cannot be broken down further | "It is raining." |
| Compound | Built from atomic propositions using connectives | "It is raining AND it is cold." |
1.3 Logical Connectives
| Name | Symbol | Read As | Meaning |
|---|---|---|---|
| Negation | ยฌp | "not p " | Opposite truth value |
| Conjunction | pโงq | " p and q " | True iff both true |
| Disjunction | pโจq | " p or q " | True iff at least one true (inclusive) |
| Conditional | pโq | "if p then q " | False only when p true and q false |
| Biconditional | pโq | " p iff q " | True when p and q have same truth value |
Truth Tables
pTTFFโqTFTFโยฌpFFTTโpโงqTFFFโpโจqTTTFโpโqTFTTโpโqTFFTโโTricky Case: Implication (pโq)
The implication "if p then q" is vacuously true when p is false. This often confuses beginners.
Example: "If it rains (p), then I'll take an umbrella (q)."
- It rains and I take umbrella: TโT=T (kept promise)
- It rains and I don't take umbrella: TโF=F (broke promise)
- No rain and I take umbrella: FโT=T (still true โ didn't break anything)
- No rain and I don't take umbrella: FโF=T (also true)
1.4 Tautologies, Contradictions, Contingencies
| Type | Definition | Example |
|---|---|---|
| Tautology | Always true | pโจยฌp (law of excluded middle) |
| Contradiction | Always false | pโงยฌp |
| Contingency | Neither | pโงq |
Proving a Tautology
To show pโจยฌp is a tautology:
All entries in the result column are T โ it's a tautology.
1.5 Logical Equivalence
Two statements are logically equivalent (โก) if they have the same truth value for all assignments.
De Morgan's Laws
ยฌ(pโงq)โกยฌpโจยฌq ยฌ(pโจq)โกยฌpโงยฌqProof by truth table:
Columns 3=4 and 5=6, proving both equivalences.
Other Key Equivalences
| Name | Law |
|---|---|
| Commutativity | pโงqโกqโงp ; pโจqโกqโจp |
| Associativity | (pโงq)โงrโกpโง(qโงr) |
| Distributivity | pโง(qโจr)โก(pโงq)โจ(pโงr) |
| Identity | pโงTโกp ; pโจFโกp |
| Domination | pโจTโกT ; pโงFโกF |
| Double negation | ยฌ(ยฌp)โกp |
| Implication | pโqโกยฌpโจq |
| Contrapositive | pโqโกยฌqโยฌp |
| Biconditional | pโqโก(pโq)โง(qโp) |
1.6 Conditional and Related Statements
For pโq:
| Name | Form | Example |
|---|---|---|
| Original | pโq | If it rains, I'll take umbrella |
| Converse | qโp | If I take umbrella, it rains |
| Inverse | ยฌpโยฌq | If no rain, I won't take umbrella |
| Contrapositive | ยฌqโยฌp | If no umbrella, no rain |
Important: Original and contrapositive are logically equivalent. Converse and inverse are not equivalent to the original.
๐ Formula Summary
| Equivalence | Rule |
|---|---|
| Implication | pโqโกยฌpโจq |
| Contrapositive | pโqโกยฌqโยฌp |
| De Morgan (AND) | ยฌ(pโงq)โกยฌpโจยฌq |
| De Morgan (OR) | ยฌ(pโจq)โกยฌpโงยฌq |
| Distributive | pโง(qโจr)โก(pโงq)โจ(pโงr) |
โ Practice Questions
Q1: Is (pโq)โง(qโr)โ(pโr) a tautology?
>pTTTTFFFFโqTTFFTTFFโrTFTFTFTFโqโrTFTTTFTTโpโ(qโr)TFTTTTTTโpโงqTTFFFFFFโ(pโงq)โrTFTTTTTTโโ>SolutionThis is hypothetical syllogism, a famous tautology. Proof: construct truth table. The only way to make it false would require pโq true, qโr true, and pโr false. pโr false requires p=T,r=F. Then pโq true with p=T requires q=T. Then qโr with q=T,r=F gives F. Contradiction. So it's always true. Q2: Prove ยฌ(pโq)โกpโงยฌq. Solutionpโqโกยฌpโจq, so ยฌ(pโq)โกยฌ(ยฌpโจq)โกpโงยฌq (by De Morgan and double negation). Q3: Write the contrapositive of: "If a number is divisible by 6, then it is divisible by 2 and 3." SolutionContrapositive: "If a number is NOT divisible by 2 OR NOT divisible by 3, then it is NOT divisible by 6." Q4: Use truth tables to prove pโ(qโr)โก(pโงq)โr. Solution
Columns 5 and 7 match exactly. Q5: Simplify ยฌ(pโจยฌq). Solution