Quiz 2

Propositional Logic

1269 words
6 min read
Python Week 1: the first filter for runtime behavior
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: \land, \lor, ¬\neg, \to, \leftrightarrow
  • 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.
ExampleProposition?Truth Value
"The sky is blue."YesTrue
"2 + 2 = 5."YesFalse
"Please sit down."No (imperative)
"This statement is false."No (paradox)
" x>5x > 5 "No (open sentence)Depends on xx

Atomic vs. Compound Propositions

TypeDefinitionExample
AtomicCannot be broken down further"It is raining."
CompoundBuilt from atomic propositions using connectives"It is raining AND it is cold."

1.3 Logical Connectives

NameSymbolRead AsMeaning
Negation¬p\neg p"not pp "Opposite truth value
Conjunctionpqp \land q" pp and qq "True iff both true
Disjunctionpqp \lor q" pp or qq "True iff at least one true (inclusive)
Conditionalpqp \to q"if pp then qq "False only when pp true and qq false
Biconditionalpqp \leftrightarrow q" pp iff qq "True when pp and qq have same truth value

Truth Tables

pq¬ppqpqpqpqTTFTTTTTFFFTFFFTTFTTFFFTFFTT\begin{array}{c|c||c|c|c|c|c} p & q & \neg p & p \land q & p \lor q & p \to q & p \leftrightarrow q \\ \hline T & T & F & T & T & T & T \\ T & F & F & F & T & F & F \\ F & T & T & F & T & T & F \\ F & F & T & F & F & T & T \end{array}

Tricky Case: Implication (pqp \to q)

The implication "if pp then qq" is vacuously true when pp is false. This often confuses beginners. Example: "If it rains (pp), then I'll take an umbrella (qq)."
  • It rains and I take umbrella: TT=TT \to T = T (kept promise)
  • It rains and I don't take umbrella: TF=FT \to F = F (broke promise)
  • No rain and I take umbrella: FT=TF \to T = T (still true — didn't break anything)
  • No rain and I don't take umbrella: FF=TF \to F = T (also true)

1.4 Tautologies, Contradictions, Contingencies

TypeDefinitionExample
TautologyAlways truep¬pp \lor \neg p (law of excluded middle)
ContradictionAlways falsep¬pp \land \neg p
ContingencyNeitherpqp \land q

Proving a Tautology

To show p¬pp \lor \neg p is a tautology:
p¬pp¬pTFTFTT\begin{array}{c|c|c} p & \neg p & p \lor \neg p \\ \hline T & F & T \\ F & T & T \end{array}
All entries in the result column are TT → it's a tautology.

1.5 Logical Equivalence

Two statements are logically equivalent (\equiv) if they have the same truth value for all assignments.

De Morgan's Laws

¬(pq)¬p¬q\neg(p \land q) \equiv \neg p \lor \neg q ¬(pq)¬p¬q\neg(p \lor q) \equiv \neg p \land \neg q
Proof by truth table:
pq¬(pq)¬p¬q¬(pq)¬p¬qTTFFFFTFTTFFFTTTFFFFTTTT\begin{array}{c|c|c|c|c|c|c} p & q & \neg(p \land q) & \neg p \lor \neg q & \neg(p \lor q) & \neg p \land \neg q \\ \hline T & T & F & F & F & F \\ T & F & T & T & F & F \\ F & T & T & T & F & F \\ F & F & T & T & T & T \end{array}
Columns 3=4 and 5=6, proving both equivalences.

Other Key Equivalences

NameLaw
Commutativitypqqpp \land q \equiv q \land p ; pqqpp \lor q \equiv q \lor p
Associativity(pq)rp(qr)(p \land q) \land r \equiv p \land (q \land r)
Distributivityp(qr)(pq)(pr)p \land (q \lor r) \equiv (p \land q) \lor (p \land r)
IdentitypTpp \land T \equiv p ; pFpp \lor F \equiv p
DominationpTTp \lor T \equiv T ; pFFp \land F \equiv F
Double negation¬(¬p)p\neg(\neg p) \equiv p
Implicationpq¬pqp \to q \equiv \neg p \lor q
Contrapositivepq¬q¬pp \to q \equiv \neg q \to \neg p
Biconditionalpq(pq)(qp)p \leftrightarrow q \equiv (p \to q) \land (q \to p)
For pqp \to q:
NameFormExample
Originalpqp \to qIf it rains, I'll take umbrella
Converseqpq \to pIf I take umbrella, it rains
Inverse¬p¬q\neg p \to \neg qIf no rain, I won't take umbrella
Contrapositive¬q¬p\neg q \to \neg pIf no umbrella, no rain
Important: Original and contrapositive are logically equivalent. Converse and inverse are not equivalent to the original.

📊 Formula Summary

EquivalenceRule
Implicationpq¬pqp \to q \equiv \neg p \lor q
Contrapositivepq¬q¬pp \to q \equiv \neg q \to \neg p
De Morgan (AND)¬(pq)¬p¬q\neg(p \land q) \equiv \neg p \lor \neg q
De Morgan (OR)¬(pq)¬p¬q\neg(p \lor q) \equiv \neg p \land \neg q
Distributivep(qr)(pq)(pr)p \land (q \lor r) \equiv (p \land q) \lor (p \land r)

✅ Practice Questions

Q1: Is (pq)(qr)(pr)(p \to q) \land (q \to r) \to (p \to r) a tautology?
Solution
This is hypothetical syllogism, a famous tautology. Proof: construct truth table. The only way to make it false would require pqp \to q true, qrq \to r true, and prp \to r false. prp \to r false requires p=T,r=Fp=T, r=F. Then pqp \to q true with p=Tp=T requires q=Tq=T. Then qrq \to r with q=T,r=Fq=T, r=F gives FF. Contradiction. So it's always true. Q2: Prove ¬(pq)p¬q\neg(p \to q) \equiv p \land \neg q. Solution
pq¬pqp \to q \equiv \neg p \lor q, so ¬(pq)¬(¬pq)p¬q\neg(p \to q) \equiv \neg(\neg p \lor q) \equiv p \land \neg 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." Solution
Contrapositive: "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(qr)(pq)rp \to (q \to r) \equiv (p \land q) \to r. Solution
>pqrqrp(qr)pq(pq)rTTTTTTTTTFFFTFTFTTTFTTFFTTFTFTTTTFTFTFFTFTFFTTTFTFFFTTFT>> \begin{array}{c|c|c|c|c|c} p & q & r & q \to r & p \to (q \to r) & p \land q & (p \land q) \to r \\ \hline T & T & T & T & T & T & T \\ T & T & F & F & F & T & F \\ T & F & T & T & T & F & T \\ T & F & F & T & T & F & T \\ F & T & T & T & T & F & T \\ F & T & F & F & T & F & T \\ F & F & T & T & T & F & T \\ F & F & F & T & T & F & T \end{array} >
Columns 5 and 7 match exactly. Q5: Simplify ¬(p¬q)\neg(p \lor \neg q). Solution
¬(p¬q)¬p¬(¬q)¬pq\neg(p \lor \neg q) \equiv \neg p \land \neg(\neg q) \equiv \neg p \land q Join Discord NextPredicate Logic
Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.