Propositional logic is the grammar of mathematical reasoning. It gives precise rules for combining true/false statements with ∼ ∧ ∨ → ↔, deciding when two compound statements have the same truth value, and testing whether an argument's form forces its conclusion to follow from its premises.
Where it is used. These rules are the foundation for every later chapter: predicates and quantifiers (Ch 3), proofs (Ch 4), set theory (Ch 6), and induction (Ch 5) all stand on the logic you build here. They also map directly onto programming (if/else, boolean expressions), digital circuits (AND/OR/NOT gates), and database queries (WHERE clauses).
A statement (or proposition) is a sentence that is either true or false, but not both. Statements built from simple statements joined by connectives (∼ ∧ ∨ → ↔) are compound statements, the focus of this chapter.
Statements:
Not statements:
In propositional logic we label statements with letters like p, q, r and combine them with the connectives below.
They are not equivalent. Build both truth tables side by side and look at the row where they disagree:
The row p = F, q = F, r = T makes the left side F and the right side T. That single mismatch is enough to fail equivalence.
Lesson. ∧ does not distribute the way you might guess. The correct distributive law is p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r), note the second ∧ on the right. Check it below; every row matches:
Let h = "it is hot" and m = "it is humid".
(i) Negation of h ∧ m:
∼(h ∧ m) ≡ ∼h ∨ ∼m (first De Morgan law)
In words: "It is not hot, or it is not humid."
(ii) Negation of h ∨ m:
∼(h ∨ m) ≡ ∼h ∧ ∼m (second De Morgan law)
In words: "It is not hot, and it is not humid."
Watch the connective flip: ∧ becomes ∨ in (i), and ∨ becomes ∧ in (ii).
(1) (p ∧ q) ∨ (∼p ∨ ∼q). By De Morgan, ∼p ∨ ∼q ≡ ∼(p ∧ q), so the form is X ∨ ∼X, always true. The truth table confirms:
(2) p ∧ (∼p ∨ q). Sometimes T, sometimes F:
(3) ∼(p ∧ ∼p). p ∧ ∼p is a contradiction (always false), so its negation is always true:
Each step replaces a sub-expression with an equivalent one from Theorem 2.1.1:
∼(∼p ∧ q) ∧ (p ∨ q) ≡ (∼(∼p) ∨ ∼q) ∧ (p ∨ q) by De Morgan's law ≡ (p ∨ ∼q) ∧ (p ∨ q) by double negative ≡ p ∨ (∼q ∧ q) by the distributive law ≡ p ∨ (q ∧ ∼q) by commutativity for ∧ ≡ p ∨ c by the negation law (q ∧ ∼q is a contradiction) ≡ p by the identity law (p ∨ c ≡ p)
Verify the start/end equivalence with the checker:
This form is true precisely when exactly one of p, q is true. That is the exclusive or p ⊕ q:
In other words: p ⊕ q ≡ (p ∧ ∼q) ∨ (∼p ∧ q). This is one of the standard equivalent forms for XOR (the slides give the other: (p ∨ q) ∧ ∼(p ∧ q)).
The conditional (→) p → q (read "if p then q") is the workhorse of mathematical reasoning. The only way p → q is false is when p is true but q is false. The rows where p is false make the conditional vacuously true, a topic revisited in 3.2.
Let p = "today is Friday", q = "I have an exam".
Original (p → q): If today is Friday, then I have an exam.
Contrapositive (∼q → ∼p): "If I do not have an exam, then today is not Friday." ✓ logically equivalent.
Converse (q → p): "If I have an exam, then today is Friday." ✗ not equivalent; exams happen on other days too.
Inverse (∼p → ∼q): "If today is not Friday, then I do not have an exam." ✗ not equivalent; same flaw as converse.
(1) "p sufficient for q" translates to p → q:
"If a number is divisible by 6, then it is divisible by 2."
(2) "p only if q" translates to p → q:
"If a polygon is a triangle, then it has exactly 3 sides."
(3) "p necessary for q" translates to q → p:
"If the program runs, then it has been compiled."
Build both truth tables. Identical columns confirm equivalence:
How we use it. This is the bridge from conditional reasoning to the basic connectives. It lets us apply De Morgan to negate conditionals:
∼(p → q) ≡ ∼(∼p ∨ q) ≡ p ∧ ∼q
So the negation of "if p then q" is "p and not q", used constantly in proofs.
Let p = "Sara studies hard", q = "Sara passes the exam".
Original: p → q. Negation: ∼(p → q) ≡ p ∧ ∼q.
In words: "Sara studies hard and she does not pass the exam."
Confirm with the equivalence checker:
Caution. A common mistake is to negate as "If Sara studies hard, then she does not pass". That has the wrong logical shape, it is still an "if … then" statement, not its negation.
(1) "p if q",if introduces the hypothesis, so q is the hypothesis: q → p. (Passing is sufficient for the diploma.)
(2) "p only if q", p cannot happen without q, so p → q. (Passing is necessary for the diploma.) Equivalently ∼q → ∼p, no passing means no diploma.
(3) "p if and only if q", both directions: p ↔ q ≡ (q → p) ∧ (p → q).
Notice the arrows in (1) and (2) point in opposite directions. That is the most common confusion in Section 2.2.
An argument is a sequence of statements: some premises followed by a conclusion.
An argument form is valid when, in every row of the truth table where all premises are true, the conclusion is also true. If there is even one row where every premise is true but the conclusion is false, the argument form is invalid.
Important. Validity is about form, not about whether the premises happen to be true. An argument can be valid with false premises and an absurd conclusion. What we check is whether the form preserves truth.
If today is a holiday, the library is closed.
Today is not a holiday.
∴ The library is not closed.
Let p = "today is a holiday", q = "the library is closed".
Form: p → q, ∼p ∴ ∼q. This is the inverse error,invalid. The truth table shows the breakage:
Read the red row: p = F, q = T. Both premises are true (p → q is vacuously true; ∼p is true) but the conclusion ∼q is false. The library could be closed for other reasons (Sunday, renovation),the form does not rule that out.
Verify by selecting "Inverse error" in the checker above.
If 2 + 2 = 5, then 1 = 0.
2 + 2 ≠ 5.
∴ 1 ≠ 0.
Let p = "2 + 2 = 5", q = "1 = 0". Form: p → q, ∼p ∴ ∼q, the inverse error again. Invalid.
Even though the conclusion happens to be true in the real world (1 ≠ 0 is correct), validity is about form, not content. The form does not force the conclusion.
Key lesson. An argument can have a true conclusion and still be invalid. Validity asks: does the form guarantee the conclusion is true whenever the premises are?
If Ahmad is in COMP233, then he studies discrete math.
If Ahmad studies discrete math, then he learns about proofs.
Ahmad is in COMP233.
∴ Ahmad learns about proofs.
Let c = "Ahmad is in COMP233", d = "Ahmad studies discrete math", p = "Ahmad learns about proofs".
Premises:
(1) c → d
(2) d → p
(3) c
Step 1. Apply Transitivity to (1) and (2):
c → d, d → p ∴ c → p
Step 2. Apply Modus Ponens to the result and (3):
c → p, c ∴ p
Therefore p,"Ahmad learns about proofs". ✓ Valid.
If today is Friday, then today is a holiday.
Today is not a holiday.
∴ Today is not Friday.
Let p = "today is Friday", q = "today is a holiday". Form: p → q, ∼q ∴ ∼p. This is Modus Tollens (Rule 2), valid.
Read the yellow row: the single critical row (both premises T) also makes the conclusion T. The form preserves truth.
(a) If I was reading in the kitchen, then my glasses are on the kitchen table. RK → GKChain the rules of inference to find where the glasses are.
(b) If my glasses are on the kitchen table, then I saw them at breakfast. GK → SB
(c) I did not see my glasses at breakfast. ∼SB
(d) I was reading in the living room or in the kitchen. RL ∨ RK
(e) If I was reading in the living room, then my glasses are on the coffee table. RL → GC
Conclusion. The glasses are on the coffee table. Four short rules replace a 32-row truth table (five variables). That is the value of inference rules once you leave Chapter 2.