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
pTTFFqTFTF¬pFFTTp∧qTFFFp∨qTTTFp→qTFTTp↔qTFFTTricky 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?
>pTTTTFFFFqTTFFTTFFrTFTFTFTFq→rTFTTTFTTp→(q→r)TFTTTTTTp∧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