Raw

Lecture 6. Propositional logic

6.0 Overview and motivation

In Lecture 4 and Lecture 5 we studied Boolean algebra: an algebraic structure with operations \wedge, \vee, and complement on the two-element set {0,1}\{0,1\}, together with a body of laws (commutativity, distributivity, De Morgan, and the rest). We manipulated expressions the way we manipulate ordinary algebra — by rewriting, factoring, and simplifying.

Propositional logic is the same machinery seen from a different angle — the angle of meaning and truth rather than algebraic manipulation. Instead of bits and gates we now speak of propositions (declarative sentences), the connectives that glue them together, and the central question: when is a compound sentence true? The two subjects are, quite literally, two dialects of one theory. Where Lecture 4 wrote 11 we now write TT; where it wrote xy=yxx \cdot y = y \cdot x we now write pqqpp \wedge q \equiv q \wedge p. This is not a loose analogy — it is an isomorphism, and §6.9 makes it precise.

Why build a formal language for something as ordinary as “and”, “or”, and “if”? Three reasons, each a theme of the whole course:

  • Precision. Natural language is ambiguous (“or” can be inclusive or exclusive; “if” is often mistaken for “if and only if”). A formal language forces every sentence to have exactly one structure and exactly one truth value per interpretation.
  • Mechanization. Once meaning is reduced to a finite table lookup, a machine can check whether an argument is valid, whether a circuit meets its specification, or whether a configuration of constraints can be satisfied. This is the birthplace of automated reasoning, SAT solvers, and hardware/software verification.
  • Foundation for proof. Every proof you will write in Lecture 7 and beyond — direct proof, contraposition, contradiction, cases — is a disciplined way of establishing exactly the semantic relationships defined here. You cannot say what a proof proves until you can say what its statements mean.

We treat propositional logic as a formal system in three layers, and this lecture is organized around them:

  • Syntax (§6.5) — what counts as a legal formula: well-formed formulas, connectives, parenthesization, precedence, parse trees. Pure grammar, no truth involved.
  • Semantics (§6.6) — how a formula acquires a truth value once we fix the truth values of its atoms: interpretations, the recursive definition of truth, truth tables.
  • Meta-theory (§6.7–§6.11) — classifying formulas (tautology, contradiction, contingency), testing satisfiability (SAT), deciding when two formulas mean the same thing (\equiv), reducing formulas to normal forms (CNF, DNF), and deciding when a sentence follows from others (\models).

Remark (where we stop). This lecture is about truth, decided ultimately by inspecting a truth table. How to derive consequences by rules of inference (modus ponens, natural deduction) and how to organize those rules into proof techniques belongs to Lecture 7. The distinction — semantics (\models) versus proof theory (\vdash) — is fundamental and is drawn explicitly in §6.12. Keep it in mind throughout: here, nothing is ever “derived”; everything is computed or checked.


6.1 Statements and propositions

Definition (proposition). A statement (or proposition) is a declarative sentence that is either true or false, but not both and not neither.

The two possible values form the tiny truth-value set {True,False}\{\text{True}, \text{False}\}, written {T,F}\{T, F\} or {1,0}\{1, 0\}. Whether we currently know which value a sentence has is irrelevant; what matters is that it has exactly one. “There are infinitely many twin primes” is a perfectly good proposition even though, at the time of writing, no one knows whether it is true.

Consider the sentences a logic course traditionally opens with:

  • “The Dnipro flows into the Black Sea.” — a statement; it happens to be true.
  • “The Dnipro flows into the Sea of Azov.” — a statement; it happens to be false.
  • “What’s the date today?”not a statement. It is a question; it cannot be assigned TT or FF.

Sentences that are not propositions include:

  • questions“What time is it?”;
  • commands / imperatives“Close the door.”;
  • exclamations“How cold it is!”;
  • paradoxical self-referential sentences“This sentence is false.” If it were true it would be false, and if false, true; it can be assigned neither value consistently, so it lies outside the realm of propositions altogether. (This is the Liar paradox, and the care needed to exclude such sentences is one reason a formal syntax matters.)

Definition (open sentence). A sentence containing a free variable whose truth value depends on the value substituted for that variable is an open sentence (a propositional function or predicate).

A subtler case than the ones above is XX is divisible by 5.” This has no fixed truth value on its own: it depends on XX. It becomes a genuine proposition only after XX is given a concrete value — for X=15X = 15 it is true, for X=8X = 8 it is false. Propositional logic treats only closed sentences with definite truth values; open sentences, together with the quantifiers “for all” (\forall) and “there exists” (\exists) needed to close them, are the subject of predicate (first-order) logic, which the course takes up later.

Example 6.1 (classification). Classify each sentence. (a) 77 is a prime number.” (b) “Please pass the salt.” (c) n20n^2 \ge 0 for the integer nn.” (d) “Is it raining?” (e) x+3=10x + 3 = 10.”

Solution. (a) proposition, true. (b) not a proposition (imperative). (c) proposition, true — the variable nn is bound by the phrase “for the integer nn”, which quantifies it, so the sentence as a whole makes a definite (true) claim. (d) not a proposition (question). (e) open sentence — true when x=7x=7, false otherwise; a proposition only once xx is fixed.

Common pitfall. Do not confuse “we don’t know its truth value” with “it has no truth value.” The Goldbach conjecture is a proposition (exactly one of true/false), even though its status is open. By contrast x+3=10x+3=10 genuinely has no truth value until xx is supplied — it is a different kind of object, an open sentence.


6.2 Atomic and compound propositions

Definition (atom). An atom (atomic proposition) is a simple declarative sentence that contains no logical connective and cannot be decomposed into smaller propositions — “a simple narrative sentence.” Atoms are the indivisible building blocks of the language. We denote them by propositional variables: p,q,r,s,p, q, r, s, \dots (or P,Q,R,P, Q, R, \dots).

Definition (compound proposition). A compound (or molecular) proposition is one built from atoms using logical connectives.

The defining feature of the language is captured by one principle:

Principle of truth-functionality. The truth value of a compound proposition is determined completely by the truth values of its atoms together with the meanings of its connectives — and by nothing else.

Truth-functionality is a genuine restriction, and it is what makes the whole theory computable. It says the connective “and” contributes only a rule for combining truth values; it is blind to what the atoms say, whether they are related in meaning, whether one causes the other, or whether they are even about the same topic. The compound 2+2=42+2=4 and Kyiv is a city” is true for exactly the same reason as “grass is green and snow is white”: both conjuncts are true. English connectives sometimes smuggle in extra meaning (temporal order in “she opened the door and left”); propositional logic deliberately discards all of that.

Example 6.2. “Peter was late” is an atom, say PP. “Peter was late and Peter was speeding” is compound: PQP \wedge Q, where QQ is the atom “Peter was speeding.” The whole sentence carries no truth value of its own beyond what PP, QQ, and \wedge supply.


6.3 Logical connectives

Propositional logic uses five standard connectives. Negation is unary (applies to one formula); the other four are binary (combine two).

Connective Symbol Reads as Natural-language cues
Negation ¬p\neg p “not pp not; it is not the case that; fails to
Conjunction pqp \wedge q pp and qq and; but; both … and; yet; although
Disjunction pqp \vee q pp or qq or; either … or (inclusive)
Implication pqp \to q “if pp then qq if …, then …; only if; implies; is sufficient for
Biconditional pqp \leftrightarrow q pp if and only if qq iff; exactly when; is necessary and sufficient for

Each connective is defined by how it computes a truth value; those definitions are the rows of the base truth table in §6.6. Four points of natural-language nuance deserve emphasis now.

(1) “But” is \wedge. Logically, “it is raining but the sun is shining” is just the conjunction pqp \wedge q. English uses “but” to signal contrast or surprise; truth-functionally there is no such thing, and pqp \wedge q is true precisely when both parts are.

(2) Disjunction is inclusive. pqp \vee q is true when at least one of p,qp, q holds, including when both hold. English “or” is sometimes exclusive (“soup or salad, not both”); that meaning is a different connective, exclusive-or pqp \oplus q, expressible as

pq    (pq)¬(pq)    (p¬q)(¬pq).p \oplus q \;\equiv\; (p \vee q) \wedge \neg(p \wedge q) \;\equiv\; (p \wedge \neg q) \vee (\neg p \wedge q).

When a menu says “soup or salad” it means \oplus; when a scholarship says “open to students who study mathematics or computer science” it means \vee (a double major still qualifies). Which one is intended is a matter of translation, not of logic.

(3) Implication is truth-functional and needs no causal link. pqp \to q is false in exactly one case: antecedent pp true and consequent qq false. In every other case it is true. In particular, when the antecedent pp is false, pqp \to q is vacuously true, regardless of qq“if the moon is made of cheese, then 2+2=52+2=5 is a true implication. Here pp is the antecedent (hypothesis) and qq the consequent (conclusion). Implication captures the pattern “qq is guaranteed whenever pp”, not “pp causes qq”.

(4) The four English faces of pqp \to q. All of the following translate to pqp \to q: “if pp, then qq; pp only if qq; pp is sufficient for qq; qq is necessary for pp; qq whenever pp; qq follows from pp.” The two easy-to-miss ones are “only if” and “necessary”: “pp only if qq” does not say qpq \to p — it says that pp can hold only in circumstances where qq also holds, i.e. pqp \to q.

Related to pqp\to q are three formulas built from the same atoms; distinguishing them is a constant source of error:

  • converse: qpq \to p;
  • inverse: ¬p¬q\neg p \to \neg q;
  • contrapositive: ¬q¬p\neg q \to \neg p.

Common pitfall (affirming/denying traps). A conditional is not equivalent to its converse or its inverse. “If it rains, the ground is wet” (pqp\to q) does not entail “if the ground is wet, it rained” (converse — the sprinkler could be on) nor “if it does not rain, the ground is not wet” (inverse). It is equivalent to its contrapositive “if the ground is not wet, it did not rain” — a fact we prove in §6.9 and use constantly in Lecture 7.

Remark (other connectives). Two further binary connectives matter in computer science: NAND pq¬(pq)p \mathbin{\uparrow} q \equiv \neg(p\wedge q) and NOR pq¬(pq)p \mathbin{\downarrow} q \equiv \neg(p \vee q). §6.10 shows every connective can be expressed with {¬,,}\{\neg,\wedge,\vee\}; remarkably, NAND alone (or NOR alone) also suffices, which is why entire chips are built from one gate type.


6.4 Formalization: from natural language to formulas

Formalization (translation, symbolization) is the act of replacing atoms by variables and connective-words by symbols. It is the first practical skill of the subject and the bridge between messy language and computable logic.

Formalizing an English sentence into the propositional formula r → w

The method:

  1. Identify the atomic propositions and assign each a variable. Choose atoms to be positive where possible (let pp = “the door is open”, not “the door is closed”), so that negations show up explicitly.
  2. Locate the connective words (“and”, “or”, “if…then”, “not”, “unless”, “only if”, …).
  3. Determine the grouping (scope) — this is the step that requires judgment — and insert parentheses accordingly.

Example 6.3 (the “Peter” sentence). “Because Peter was late, he was speeding, and therefore he is not a good driver.” Atoms: PP = “Peter was late”, QQ = “Peter was speeding”, SS = “Peter is a good driver”. The sentence asserts: if (Peter’s being late led to QQ) then not SS. Formalized:

(PQ)¬S.(P \to Q) \to \neg S.

Translation is not mechanical: cue words guide it, but scope and grouping require reading the sentence’s intent. The placement of “not” is especially treacherous.

Example 6.4 (scope of negation). “Not both pp and qq   =  ¬(pq)\;=\; \neg(p \wedge q) — at least one fails. “Both not pp and not qq   =  ¬p¬q\;=\; \neg p \wedge \neg q — both fail. These are genuinely different formulas: the first is true when p=T,q=Fp=T, q=F, the second is not. (By De Morgan, ¬(pq)¬p¬q\neg(p\wedge q) \equiv \neg p \vee \neg q, so the first equals “¬p\neg p or ¬q\neg q” — note the or.)

Example 6.5 (“unless”). “You will pass unless you cheat.” Read “AA unless BB” as “AA if not BB”, i.e. ¬BA\neg B \to A, equivalently BAB \vee A. With AA = “you pass”, BB = “you cheat”:

¬BABA.\neg B \to A \quad\equiv\quad B \vee A.

Example 6.6 (“neither…nor” and “only if”). “Neither pp nor qq =¬p¬q    ¬(pq)= \neg p \wedge \neg q \;\equiv\; \neg(p \vee q). pp only if qq =pq= p \to q (not qpq \to p!). pp if qq =qp= q \to p. pp if and only if qq =pq= p \leftrightarrow q.

Example 6.7 (a compound argument to formula). “If the program compiles and the tests pass, then we deploy; we did not deploy; the tests passed. So the program did not compile.” Atoms cc = “compiles”, tt = “tests pass”, dd = “we deploy”. Premises: (ct)d,  ¬d,  t(c \wedge t)\to d,\; \neg d,\; t. Conclusion: ¬c\neg c. (We check whether this argument is valid in §6.11.)

Common pitfall (the “and”/“or” reversal after “not”). Everyday speech says “you can’t have cake and ice cream” to mean you can have at most one — logically ¬(ci)\neg(c \wedge i), which is ¬c¬i\neg c \vee \neg i. The English keeps “and”, but the correct paraphrase uses “or”. Always translate the meaning, then let De Morgan reconcile it with the words.


6.5 Syntax: well-formed formulas

Syntax is grammar with truth deliberately set aside. Before we can ask what a formula means, we must fix exactly which strings of symbols are formulas. This matters for the same reason a compiler has a grammar: only well-formed input can be assigned a meaning, and the meaning must be unambiguous.

Definition (well-formed formula). The well-formed formulas (WFFs) of propositional logic over a set of propositional variables are defined by recursion:

  1. (base) Every propositional variable p,q,r,p, q, r, \dots is a WFF (an atom).
  2. (negation) If φ\varphi is a WFF, then (¬φ)(\neg\varphi) is a WFF.
  3. (binary) If φ\varphi and ψ\psi are WFFs, then (φψ)(\varphi \wedge \psi), (φψ)(\varphi \vee \psi), (φψ)(\varphi \to \psi), and (φψ)(\varphi \leftrightarrow \psi) are WFFs.
  4. (closure) Nothing else is a WFF.

Clause 4 is essential: it says the WFFs are the smallest set closed under 1–3. This is what licenses the two most important tools of the subject — proof by structural induction and definition by structural recursion.

Thus ((pq)(¬r))((p \to q) \wedge (\neg r)) is well-formed, while pqp\,q\to,   p\;\wedge p, and (pq)(p \to \to q) are not.

Remark (fully parenthesized vs. readable). The definition above puts parentheses around every application, which makes the theory clean but the formulas ugly. In practice we drop the outermost parentheses and the parentheses around negation, and we use precedence and associativity conventions to reinsert the rest.

Precedence and associativity. From tightest binding (evaluated first) to loosest:

¬  >    >    >    >  \neg \;>\; \wedge \;>\; \vee \;>\; \to \;>\; \leftrightarrow

Binary connectives associate to the right, so pqrp \to q \to r abbreviates p(qr)p \to (q \to r). Under these rules,

¬pqrabbreviates(((¬p)q)r).\neg p \vee q \to r \quad\text{abbreviates}\quad (((\neg p) \vee q) \to r).

Common pitfall (association of \to). Right-association is a convention for abbreviation, not a logical law: (pq)r(p \to q) \to r and p(qr)p \to (q \to r) are not equivalent. Their truth tables differ:

pp qq rr (pq)r(p\to q)\to r p(qr)p\to(q\to r)
F F F F T
F F T T T
F T F F T
F T T T T
T F F T T
T F T T T
T T F F F
T T T T T

The columns disagree in rows 1 and 3. When in doubt, write the parentheses.

Parse trees and the main connective

Every WFF corresponds to a unique parse tree (syntax tree): leaves are atoms, internal nodes are connectives, and each connective’s children are the trees of its immediate subformulas. The connective at the root — the one applied last — is the main connective. Identifying the main connective is the key step in reading and evaluating a formula, because it tells you the outermost structure.

Parse tree of (p ∧ q) → ¬r, with the main connective at the root

Example 6.8. The parse tree of ((pq)(¬r))((p \to q) \wedge (\neg r)):

           ∧            ← main connective
         /   \
        →     ¬
       / \     \
      p   q     r

The main connective is \wedge; its left subtree is pqp \to q and its right subtree is ¬r\neg r. Contrast:

  • In (PQ)¬S(P \to Q) \to \neg S the main connective is the second \to (left subtree PQP\to Q, right subtree ¬S\neg S).
  • In ¬(pq)\neg(p \wedge q) the main connective is ¬\neg, applied to the whole conjunction.
  • In ¬pq\neg p \wedge q the main connective is \wedge (because ¬\neg binds tighter): left subtree ¬p\neg p, right subtree qq.

Unique readability

The convenience of precedence rules rests on a theorem that is easy to take for granted and surprisingly delicate to prove: a well-formed formula can be parsed in exactly one way. Without this, “the main connective” and “the truth table” would not even be well defined.

Theorem 6.1 (Unique Readability). Every WFF is of exactly one of the following forms, and in each case its parts are uniquely determined:

  • an atom pp; or
  • (¬φ)(\neg\varphi) for a unique WFF φ\varphi; or
  • (φψ)(\varphi \circ \psi) for a unique binary connective {,,,}\circ \in \{\wedge,\vee,\to,\leftrightarrow\} and unique WFFs φ,ψ\varphi, \psi.

Proof. For a string σ\sigma over our alphabet, let w(σ)w(\sigma) be the number of “((” minus the number of “))” occurring in σ\sigma. We first establish two lemmas.

Lemma A. Every WFF φ\varphi satisfies w(φ)=0w(\varphi) = 0. We argue by structural induction on φ\varphi. If φ\varphi is an atom it contains no parentheses, so w(φ)=0w(\varphi) = 0. If φ=(¬α)\varphi = (\neg\alpha) then w(φ)=1+w(α)+(1)=w(α)=0w(\varphi) = 1 + w(\alpha) + (-1) = w(\alpha) = 0 by the induction hypothesis. If φ=(αβ)\varphi = (\alpha \circ \beta) then w(φ)=1+w(α)+w(β)1=0+0=0w(\varphi) = 1 + w(\alpha) + w(\beta) - 1 = 0 + 0 = 0. This proves Lemma A.

Lemma B. Every proper, nonempty prefix π\pi of a WFF φ\varphi satisfies w(π)>0w(\pi) > 0. (A prefix is proper if it is not all of φ\varphi.) Again by structural induction on φ\varphi.

  • Base. An atom has length 11, hence no proper nonempty prefix; the claim holds vacuously.
  • Negation, φ=(¬α)\varphi = (\neg\alpha). A proper nonempty prefix π\pi is one of: “((” (then w=1>0w=1>0); “(¬(\neg” (then w=1>0w=1>0); “(¬π(\neg\pi'” where π\pi' is a nonempty prefix of α\alpha. If π\pi' is a proper prefix of α\alpha, then w(π)=1+w(π)>1>0w(\pi) = 1 + w(\pi') > 1 > 0 by the induction hypothesis; if π=α\pi' = \alpha (the whole thing), then w(π)=1+w(α)=1+0=1>0w(\pi) = 1 + w(\alpha) = 1 + 0 = 1 > 0 by Lemma A.
  • Binary, φ=(αβ)\varphi = (\alpha \circ \beta). Enumerate the proper nonempty prefixes: “((” (w=1w=1); “(π(\pi'” with π\pi' a proper nonempty prefix of α\alpha (w=1+w(π)>1w = 1 + w(\pi') > 1); “(α(\alpha” (w=1+0=1w = 1+0 = 1); “(α(\alpha\circ” (w=1w = 1); “(απ(\alpha\circ\pi''” with π\pi'' a proper nonempty prefix of β\beta (w=1+w(π)>1w = 1 + w(\pi'') > 1); “(αβ(\alpha\circ\beta” (w=1w = 1). Every case gives w>0w > 0.

This proves Lemma B.

Consequence. No proper nonempty prefix of a WFF is itself a WFF, since a WFF has w=0w = 0 (Lemma A) but such a prefix has w>0w > 0 (Lemma B).

Now the theorem. The first symbol of a WFF determines its form: a WFF beginning with a propositional letter is that atom (atoms have length 11 and no other clause produces a string starting with a letter); a WFF beginning with “((” followed by “¬\neg” is a negation; a WFF beginning with “((” followed by anything else is a binary formula. So the three forms are mutually exclusive. For uniqueness within the binary case, suppose (αβ)=(αβ)(\alpha \circ \beta) = (\alpha' \circ' \beta') as strings. Deleting the leading “((” gives αβ)=αβ)\alpha\circ\beta) = \alpha'\circ'\beta'). The substrings α\alpha and α\alpha' both begin at the first position, so one is a prefix of the other; if they had different lengths, the shorter would be a proper nonempty prefix of the longer WFF — impossible by the Consequence. Hence α=α\alpha = \alpha', so the connective symbols align, giving =\circ = \circ', and therefore β=β\beta = \beta'. The negation case is immediate (the inner formula is the unique substring between “(¬(\neg” and the matching final “))”). ∎

Remark. Theorem 6.1 is the propositional analogue of a parser proving its grammar is unambiguous. The proof technique — a numeric invariant (ww) plus structural induction — is exactly how one reasons about balanced brackets in compilers and about balanced-parenthesis languages in formal language theory. It is why the abbreviation conventions (dropping parentheses, using precedence) are safe: each abbreviation names one and only one fully parenthesized WFF.


6.6 Semantics: interpretations and truth tables

Syntax says which strings are formulas; semantics says what they mean. Meaning here is entirely a matter of truth values.

Definition (interpretation). An interpretation (truth valuation, assignment) is a function

v:{propositional variables}{T,F}v : \{\text{propositional variables}\} \to \{T, F\}

assigning a truth value to every atom.

Because the connectives are truth-functional, an interpretation of the atoms forces the truth value of every formula built from them. The next theorem makes “forces” precise and rigorous — it is the semantic counterpart of Unique Readability.

Theorem 6.2 (the valuation extends uniquely). For every interpretation vv of the atoms there is a unique function vˉ\bar v from all WFFs to {T,F}\{T,F\} satisfying:

  1. vˉ(p)=v(p)\bar v(p) = v(p) for every atom pp;
  2. vˉ((¬φ))=T\bar v((\neg\varphi)) = T if vˉ(φ)=F\bar v(\varphi) = F, and FF otherwise;
  3. vˉ((φψ))=T\bar v((\varphi \wedge \psi)) = T iff vˉ(φ)=T\bar v(\varphi) = T and vˉ(ψ)=T\bar v(\psi) = T;
  4. vˉ((φψ))=T\bar v((\varphi \vee \psi)) = T iff vˉ(φ)=T\bar v(\varphi) = T or vˉ(ψ)=T\bar v(\psi) = T;
  5. vˉ((φψ))=F\bar v((\varphi \to \psi)) = F iff vˉ(φ)=T\bar v(\varphi) = T and vˉ(ψ)=F\bar v(\psi) = F, and TT otherwise;
  6. vˉ((φψ))=T\bar v((\varphi \leftrightarrow \psi)) = T iff vˉ(φ)=vˉ(ψ)\bar v(\varphi) = \bar v(\psi).

Proof. Existence. Define vˉ(φ)\bar v(\varphi) by structural recursion on φ\varphi, using clauses 1–6. By Theorem 6.1 every WFF matches exactly one of the forms atom / negation / binary, so exactly one clause applies at each step and the recursion is well defined; its value is computed from the strictly smaller immediate subformulas, so the recursion terminates. The resulting vˉ\bar v satisfies 1–6 by construction.

Uniqueness. Suppose ff and gg both satisfy 1–6. We show f(φ)=g(φ)f(\varphi) = g(\varphi) for all WFFs φ\varphi by structural induction. If φ\varphi is an atom, f(φ)=v(φ)=g(φ)f(\varphi) = v(\varphi) = g(\varphi) by clause 1. If φ=(¬α)\varphi = (\neg\alpha), then by the induction hypothesis f(α)=g(α)f(\alpha) = g(\alpha), and clause 2 computes f(φ)f(\varphi) and g(φ)g(\varphi) from that common value, so they agree. The binary cases are identical, using the induction hypothesis on both immediate subformulas α,β\alpha,\beta and the relevant clause 3–6. Hence f=gf = g. ∎

We henceforth write vv for both the assignment and its extension vˉ\bar v, and introduce the satisfaction symbol.

Definition (satisfaction, model). For an interpretation vv and formula φ\varphi, write

vφto meanvˉ(φ)=T,v \models \varphi \quad\text{to mean}\quad \bar v(\varphi) = T,

read “vv satisfies φ\varphi” or “vv is a model of φ\varphi.” We write v⊭φv \not\models \varphi when vˉ(φ)=F\bar v(\varphi) = F.

A formula with nn distinct atoms has exactly 2n2^n interpretations (each atom independently TT or FF) — these are precisely the rows of its truth table.

The base connective table. Theorem 6.2’s clauses, tabulated with atoms A,BA, B:

AA BB ¬A\neg A ABA \wedge B ABA \vee B ABA \to B ABA \leftrightarrow B
F F T F F T T
F T T F T T F
T F F F T F F
T T F T T T T

Read the rows as definitions: conjunction is true only when both conjuncts are true; disjunction is false only when both disjuncts are false; implication is false only in the row A=T,B=FA=T, B=F; the biconditional is true exactly when AA and BB agree.

Remark (row ordering). We list rows with FF before TT, reading each row as a binary number with F=0,T=1F=0, T=1 counting upward (00,01,10,1100, 01, 10, 11). Any fixed order works; consistency is what matters, and we keep this one throughout the lecture.

Building a truth table. To evaluate a compound formula, introduce one column per subformula, ordered by the parse tree (atoms first, main connective last). Each column is computed from earlier columns via the base table.

Example 6.9. Truth table for (pq)¬q(p \to q) \wedge \neg q (main connective \wedge):

pp qq pqp \to q ¬q\neg q (pq)¬q(p \to q) \wedge \neg q
F F T T T
F T T F F
T F F T F
T T T F F

The bold final column is the value of the whole formula under each of the 22=42^2 = 4 interpretations. It is true only when p=q=Fp = q = F.

Example 6.10 (three atoms, eight rows). Truth table for (pq)¬r(p \wedge q) \vee \neg r:

pp qq rr pqp \wedge q ¬r\neg r (pq)¬r(p\wedge q)\vee\neg r
F F F F T T
F F T F F F
F T F F T T
F T T F F F
T F F F T T
T F T F F F
T T F T T T
T T T T F T

False exactly when r=Tr=T and not both p,qp,q hold.


6.7 Classifying formulas: tautology, contradiction, contingency

Looking only at the final column of a formula’s truth table, every formula falls into exactly one of three classes.

Definitions.

  • A tautology is a formula true under every interpretation (final column all TT). Also called logically valid; we write φ\models \varphi. Example: p¬pp \vee \neg p (law of excluded middle).
  • A contradiction is a formula false under every interpretation (final column all FF). Example: p¬pp \wedge \neg p.
  • A contingency is a formula true under some interpretations and false under others. Example: pqp \to q.

The three classes — tautology, contradiction, contingency — by their truth-table columns

These classes partition the set of all formulas: every formula is exactly one of the three. They are linked by negation.

Theorem 6.3 (tautology–contradiction duality). A formula φ\varphi is a tautology if and only if ¬φ\neg\varphi is a contradiction; and φ\varphi is a contradiction if and only if ¬φ\neg\varphi is a tautology.

Proof. By clause 2 of Theorem 6.2, for every interpretation vv we have vˉ(¬φ)=T\bar v(\neg\varphi) = T iff vˉ(φ)=F\bar v(\varphi) = F. Now: φ\varphi is a tautology     \iff vˉ(φ)=T\bar v(\varphi) = T for all vv     \iff vˉ(¬φ)=F\bar v(\neg\varphi) = F for all vv     \iff ¬φ\neg\varphi is a contradiction. The second statement follows by applying the first to ¬φ\neg\varphi and using double negation (¬¬φφ\neg\neg\varphi \equiv \varphi, Theorem 6.7). ∎

Example 6.11 (verify a tautology). Show (pq)(¬q¬p)\models (p \to q) \leftrightarrow (\neg q \to \neg p) (a conditional is equivalent to its contrapositive).

pp qq pqp\to q ¬q¬p\neg q\to\neg p (pq)(¬q¬p)(p\to q)\leftrightarrow(\neg q\to\neg p)
F F T T T
F T T T T
T F F F T
T T T T T

The final column is all TT, so the formula is a tautology. (The two inner columns are equal — foreshadowing pq¬q¬pp\to q \equiv \neg q\to\neg p in §6.9.)


6.8 Satisfiability and the SAT problem

Definition (satisfiability). A formula is satisfiable if at least one interpretation makes it true — i.e. its final column contains at least one TT. A formula with no satisfying interpretation is unsatisfiable.

A satisfying assignment (p=T, q=F, r=T) makes every clause true

Thus unsatisfiable = contradiction, while tautologies and contingencies are satisfiable. The following little theorem ties satisfiability to the classification of §6.7 and to validity, and is the theoretical basis of refutation-style reasoning.

Theorem 6.4 (satisfiability/validity duality). A formula φ\varphi is a tautology if and only if ¬φ\neg\varphi is unsatisfiable.

Proof. φ\varphi is a tautology     \iff vˉ(φ)=T\bar v(\varphi)=T for all vv     \iff no vv has vˉ(φ)=F\bar v(\varphi)=F     \iff no vv has vˉ(¬φ)=T\bar v(\neg\varphi)=T     \iff ¬φ\neg\varphi is unsatisfiable. ∎

Definition (joint satisfiability). A set of formulas {φ1,,φn}\{\varphi_1, \dots, \varphi_n\} is jointly (simultaneously) satisfiable if some single interpretation makes all of them true at once — equivalently, if the conjunction φ1φn\varphi_1 \wedge \dots \wedge \varphi_n is satisfiable.

Example 6.12. Is (pq)(¬p¬q)(p \vee q) \wedge (\neg p \vee \neg q) a tautology, contradiction, or contingency, and is it satisfiable?

pp qq pqp\vee q ¬p¬q\neg p\vee\neg q whole
F F F T F
F T T T T
T F T T T
T T T F F

Mixed final column \Rightarrow contingency, hence satisfiable (e.g. by p=F,q=Tp=F, q=T). It is true exactly when exactly one of p,qp, q holds — it is the exclusive-or pqp \oplus q.

The SAT problem

The Boolean satisfiability problem (SAT) is the decision problem: given a propositional formula, is it satisfiable? A truth table always answers it — build the table, scan for a TT — but the table has 2n2^n rows for nn atoms, so the naive method becomes hopeless well before n=100n = 100 (already 210010302^{100} \approx 10^{30} rows).

SAT is a landmark of theoretical computer science:

  • Cook–Levin Theorem (1971). SAT was the first problem proved NP-complete (Stephen Cook; Leonid Levin independently). Informally, NP-complete problems are the hardest problems whose candidate solutions can be checked quickly; SAT is a “universal” such problem, in that every problem in NP reduces to it. Whether SAT admits a worst-case polynomial-time algorithm is the famous open P vs. NP question. No efficient worst-case algorithm is known, and most researchers conjecture none exists.
  • In practice, SAT is astonishingly tractable. Modern SAT solvers based on the DPLL procedure (Davis–Putnam–Logemann–Loveland) and its modern extension CDCL (conflict-driven clause learning) routinely settle formulas with millions of variables. They exploit structure — unit propagation, learning from conflicts, clever branching — rather than enumerating all 2n2^n rows.

Why CS cares. SAT (and its close cousins) is the engine behind:

  • Hardware verification / equivalence checking: to prove two circuits compute the same function, assert they differ on some input and let a SAT solver try to satisfy that assertion; unsatisfiable means the circuits are equivalent (this is exactly Theorem 6.4 at industrial scale — recall Lectures 4–5, where circuits are Boolean formulas).
  • Model checking of hardware and software (does this system ever reach a bad state?).
  • Planning, scheduling, and configuration (encode constraints as clauses; a model is a valid plan/schedule).
  • Program analysis and symbolic execution (path conditions are formulas; feasibility is satisfiability).

Remark (validity is co-SAT). By Theorem 6.4, testing whether φ\varphi is a tautology is the same as testing whether ¬φ\neg\varphi is unsatisfiable. So tautology-checking (a validity question) and SAT (a satisfiability question) are two sides of one coin, and a single SAT solver handles both.


6.9 Logical equivalence

Definition (logical equivalence). Two formulas φ\varphi and ψ\psi are logically equivalent, written φψ\varphi \equiv \psi, if they have the same truth value under every interpretation — identical final columns in the truth table.

Note the level distinction, which trips up many beginners:

Common pitfall (\equiv vs. \leftrightarrow). The symbol \leftrightarrow is a connective: φψ\varphi \leftrightarrow \psi is itself a formula, which may be true under some interpretations and false under others. The symbol \equiv is a meta-level assertion about two formulas — a statement in our mathematical English, not a symbol inside the logic. The next theorem is the precise bridge between them.

Theorem 6.5 (equivalence via the biconditional). φψ\varphi \equiv \psi if and only if φψ\varphi \leftrightarrow \psi is a tautology. Moreover, \equiv is an equivalence relation on formulas: it is reflexive, symmetric, and transitive.

Proof. By clause 6 of Theorem 6.2, for each interpretation vv, vˉ(φψ)=T\bar v(\varphi \leftrightarrow \psi) = T iff vˉ(φ)=vˉ(ψ)\bar v(\varphi) = \bar v(\psi). Therefore φψ\varphi \leftrightarrow \psi is a tautology iff vˉ(φ)=vˉ(ψ)\bar v(\varphi) = \bar v(\psi) for every vv, which is exactly the definition of φψ\varphi \equiv \psi.

For the equivalence-relation claim, work directly from the definition. Reflexive: vˉ(φ)=vˉ(φ)\bar v(\varphi) = \bar v(\varphi) for all vv, so φφ\varphi \equiv \varphi. Symmetric: if vˉ(φ)=vˉ(ψ)\bar v(\varphi) = \bar v(\psi) for all vv, then vˉ(ψ)=vˉ(φ)\bar v(\psi) = \bar v(\varphi) for all vv, so ψφ\psi \equiv \varphi. Transitive: if vˉ(φ)=vˉ(ψ)\bar v(\varphi) = \bar v(\psi) and vˉ(ψ)=vˉ(χ)\bar v(\psi) = \bar v(\chi) for all vv, then vˉ(φ)=vˉ(χ)\bar v(\varphi) = \bar v(\chi) for all vv, so φχ\varphi \equiv \chi. ∎

The next theorem is what lets us reason algebraically — replacing a subformula by an equivalent one anywhere inside a larger formula, exactly as we substitute equals in ordinary algebra.

Theorem 6.6 (substitution / replacement). Let χ\chi be a formula containing φ\varphi as a subformula, and let χ\chi' be the result of replacing that occurrence of φ\varphi by ψ\psi. If φψ\varphi \equiv \psi, then χχ\chi \equiv \chi'.

Proof. Fix any interpretation vv; since φψ\varphi\equiv\psi we have vˉ(φ)=vˉ(ψ)\bar v(\varphi) = \bar v(\psi). We show vˉ(χ)=vˉ(χ)\bar v(\chi) = \bar v(\chi') by structural induction on χ\chi, where χ\chi' is χ\chi with the marked occurrence of φ\varphi replaced by ψ\psi.

  • If the marked occurrence is all of χ\chi, then χ=φ\chi = \varphi and χ=ψ\chi' = \psi, and vˉ(χ)=vˉ(φ)=vˉ(ψ)=vˉ(χ)\bar v(\chi) = \bar v(\varphi) = \bar v(\psi) = \bar v(\chi').
  • Otherwise the occurrence lies strictly inside χ\chi, so χ\chi is not an atom. If χ=¬α\chi = \neg\alpha, the occurrence is inside α\alpha; by the induction hypothesis vˉ(α)=vˉ(α)\bar v(\alpha) = \bar v(\alpha'), and clause 2 gives vˉ(χ)=vˉ(χ)\bar v(\chi) = \bar v(\chi'). If χ=αβ\chi = \alpha \circ \beta for a binary \circ, the occurrence lies in α\alpha or in β\beta; the induction hypothesis gives vˉ(α)=vˉ(α)\bar v(\alpha) = \bar v(\alpha') and vˉ(β)=vˉ(β)\bar v(\beta) = \bar v(\beta') (the untouched side is unchanged), and the clause for \circ then gives vˉ(χ)=vˉ(χ)\bar v(\chi) = \bar v(\chi').

Since vv was arbitrary, χχ\chi \equiv \chi'. ∎

The equivalence laws

The following laws are the working toolkit. Each is a claim that two formulas are equivalent, and each is verifiable by a truth table (and provable from the others by algebra via Theorem 6.6).

Law Form
Double negation ¬¬pp\neg\neg p \equiv p
Idempotence pppp \wedge p \equiv p, ppp\quad p \vee p \equiv p
Commutativity pqqpp \wedge q \equiv q \wedge p, pqqp\quad p \vee q \equiv q \vee p
Associativity (pq)rp(qr)(p \wedge q) \wedge r \equiv p \wedge (q \wedge r), (pq)rp(qr)\quad (p \vee q) \vee r \equiv p \vee (q \vee r)
Distributivity p(qr)(pq)(pr)p \wedge (q \vee r) \equiv (p \wedge q) \vee (p \wedge r), p(qr)(pq)(pr)\quad p \vee (q \wedge r) \equiv (p \vee q) \wedge (p \vee r)
De Morgan ¬(pq)¬p¬q\neg(p \wedge q) \equiv \neg p \vee \neg q, ¬(pq)¬p¬q\quad \neg(p \vee q) \equiv \neg p \wedge \neg q
Identity pTpp \wedge T \equiv p, pFp\quad p \vee F \equiv p
Domination pTTp \vee T \equiv T, pFF\quad p \wedge F \equiv F
Complement p¬pTp \vee \neg p \equiv T, p¬pF\quad p \wedge \neg p \equiv F
Absorption p(pq)pp \vee (p \wedge q) \equiv p, p(pq)p\quad p \wedge (p \vee q) \equiv p
Implication pq¬pqp \to q \equiv \neg p \vee q
Contrapositive pq¬q¬pp \to q \equiv \neg q \to \neg p
Biconditional pq(pq)(qp)(pq)(¬p¬q)p \leftrightarrow q \equiv (p \to q) \wedge (q \to p) \equiv (p \wedge q) \vee (\neg p \wedge \neg q)

Remark (this is Lecture 4 again). These are exactly the Boolean-algebra laws of Lecture 4, with T/FT/F in place of 1/01/0, /\wedge/\vee in place of /+\cdot/+, and \equiv in place of ==. The map T1,F0T\mapsto 1, F\mapsto 0 carrying ({T,F},,,¬)(\{T,F\},\wedge,\vee,\neg) to the two-element Boolean algebra ({0,1},,+,)(\{0,1\},\cdot,+,{}') is an isomorphism: propositional logic is the two-element Boolean algebra, read semantically. Everything you proved algebraically there holds here, and vice versa.

Now we discharge the task of actually proving the load-bearing laws. Truth tables are the direct method; each is a finite check of “same final columns.”

Theorem 6.7 (double negation). ¬¬pp\neg\neg p \equiv p.

Proof.

pp ¬p\neg p ¬¬p\neg\neg p
F T F
T F T

The columns pp and ¬¬p\neg\neg p are identical. ∎

Theorem 6.8 (De Morgan’s laws). ¬(pq)¬p¬q\neg(p \wedge q) \equiv \neg p \vee \neg q and ¬(pq)¬p¬q\neg(p \vee q) \equiv \neg p \wedge \neg q.

Proof. First law:

pp qq pqp\wedge q ¬(pq)\neg(p\wedge q) ¬p\neg p ¬q\neg q ¬p¬q\neg p\vee\neg q
F F F T T T T
F T F T T F T
T F F T F T T
T T T F F F F

Columns ¬(pq)\neg(p\wedge q) and ¬p¬q\neg p\vee\neg q agree (T,T,T,F)(T,T,T,F). Second law:

pp qq pqp\vee q ¬(pq)\neg(p\vee q) ¬p\neg p ¬q\neg q ¬p¬q\neg p\wedge\neg q
F F F T T T T
F T T F T F F
T F T F F T F
T T T F F F F

Columns ¬(pq)\neg(p\vee q) and ¬p¬q\neg p\wedge\neg q agree (T,F,F,F)(T,F,F,F). ∎

Theorem 6.9 (distributivity). p(qr)(pq)(pr)p \wedge (q \vee r) \equiv (p \wedge q) \vee (p \wedge r) and p(qr)(pq)(pr)p \vee (q \wedge r) \equiv (p \vee q) \wedge (p \vee r).

Proof. First law (the second is dual; its table is checked the same way):

pp qq rr qrq\vee r p(qr)p\wedge(q\vee r) pqp\wedge q prp\wedge r (pq)(pr)(p\wedge q)\vee(p\wedge r)
F F F F F F F F
F F T T F F F F
F T F T F F F F
F T T T F F F F
T F F F F F F F
T F T T T F T T
T T F T T T F T
T T T T T T T T

The two boldfaced-in-comparison columns are both (F,F,F,F,F,T,T,T)(F,F,F,F,F,T,T,T). ∎

Theorem 6.10 (implication as disjunction). pq¬pqp \to q \equiv \neg p \vee q.

Proof.

pp qq pqp\to q ¬p\neg p ¬pq\neg p\vee q
F F T T T
F T T T T
T F F F F
T T T F T

Columns pqp\to q and ¬pq\neg p\vee q agree (T,T,F,T)(T,T,F,T). ∎

This law is the most useful of all: it lets us eliminate \to entirely and rewrite any formula using only ¬,,\neg, \wedge, \vee — the first step of the normal-form algorithm in §6.10.

Theorem 6.11 (contrapositive). pq¬q¬pp \to q \equiv \neg q \to \neg p.

Proof.

pp qq pqp\to q ¬q\neg q ¬p\neg p ¬q¬p\neg q\to\neg p
F F T T T T
F T T F T T
T F F T F F
T T T F F T

Columns pqp\to q and ¬q¬p\neg q\to\neg p agree (T,T,F,T)(T,T,F,T). ∎

Theorem 6.12 (biconditional). pq(pq)(qp)(pq)(¬p¬q)p \leftrightarrow q \equiv (p \to q) \wedge (q \to p) \equiv (p \wedge q) \vee (\neg p \wedge \neg q).

Proof.

pp qq pqp\leftrightarrow q pqp\to q qpq\to p (pq)(qp)(p\to q)\wedge(q\to p) pqp\wedge q ¬p¬q\neg p\wedge\neg q (pq)(¬p¬q)(p\wedge q)\vee(\neg p\wedge\neg q)
F F T T T T F T T
F T F T F F F F F
T F F F T F F F F
T T T T T T T F T

The columns pqp\leftrightarrow q, (pq)(qp)(p\to q)\wedge(q\to p), and (pq)(¬p¬q)(p\wedge q)\vee(\neg p\wedge\neg q) are all (T,F,F,T)(T,F,F,T). ∎

Reasoning algebraically

By Theorem 6.6 we may chain equivalences, substituting inside larger formulas, without ever drawing a truth table. This is often far faster.

Example 6.13 (simplify ¬(pq)\neg(p \to q)).

¬(pq)    ¬(¬pq)  (impl., Thm 6.10)    ¬¬p¬q  (De Morgan)    p¬q  (double neg.).\neg(p \to q) \;\equiv\; \neg(\neg p \vee q) \;\text{(impl., Thm 6.10)}\; \equiv\; \neg\neg p \wedge \neg q \;\text{(De Morgan)}\; \equiv\; p \wedge \neg q \;\text{(double neg.).}

So “not (pp implies qq)” means exactly “pp holds but qq fails” — matching the single FF-row (p=T,q=Fp=T,q=F) of the implication table.

Example 6.14 (simplify ¬(pq)\neg(p \leftrightarrow q)). Using Theorem 6.12 then De Morgan and distribution,

¬(pq)¬((pq)(¬p¬q))¬(pq)¬(¬p¬q)(¬p¬q)(pq).\neg(p\leftrightarrow q) \equiv \neg\big((p\wedge q)\vee(\neg p\wedge\neg q)\big) \equiv \neg(p\wedge q)\wedge\neg(\neg p\wedge\neg q) \equiv (\neg p\vee\neg q)\wedge(p\vee q).

That last formula is the exclusive-or of Example 6.12 — so ¬(pq)pq\neg(p\leftrightarrow q) \equiv p \oplus q, confirming that “not equivalent” means “exactly one holds”.

Example 6.15 (a chain to TT). Show (pq)p(p \wedge q) \to p is a tautology by algebra.

(pq)p¬(pq)p(¬p¬q)p(¬pp)¬qT¬qT.(p\wedge q)\to p \equiv \neg(p\wedge q)\vee p \equiv (\neg p\vee\neg q)\vee p \equiv (\neg p \vee p)\vee\neg q \equiv T \vee \neg q \equiv T.

(Steps: implication; De Morgan; commutativity/associativity; complement; domination.) A formula provably equal to TT is a tautology.


6.10 Normal forms: CNF and DNF

Normal forms are standardized shapes into which every formula can be rewritten. They matter because algorithms (SAT solvers, circuit synthesizers, Lecture 4–5 minimization) expect their input in a fixed shape.

Definitions.

  • A literal is an atom or the negation of an atom: pp or ¬p\neg p.
  • A clause is a disjunction of literals, e.g. (¬pq¬r)(\neg p \vee q \vee \neg r).
  • A term (implicant) is a conjunction of literals, e.g. (p¬qr)(p \wedge \neg q \wedge r).
  • A formula is in conjunctive normal form (CNF) if it is a conjunction of clauses: i(jij)\bigwedge_i \big(\bigvee_j \ell_{ij}\big) — an “AND of ORs”.
  • A formula is in disjunctive normal form (DNF) if it is a disjunction of terms: i(jij)\bigvee_i \big(\bigwedge_j \ell_{ij}\big) — an “OR of ANDs”.

CNF as an AND of ORs versus DNF as an OR of ANDs

Remark (which is which). Mnemonic: CNF = Conjunction on the outside; DNF = Disjunction on the outside. CNF is the input format demanded by SAT solvers. DNF makes satisfiability trivial to read off (a DNF is satisfiable iff some term contains no complementary pair p,¬pp, \neg p) but can be exponentially large.

Theorem 6.13 (existence of normal forms). Every propositional formula φ\varphi is logically equivalent to a formula in DNF and to a formula in CNF.

Proof. We give a constructive proof from the truth table of φ\varphi; let its atoms be p1,,pnp_1, \dots, p_n.

DNF. If φ\varphi is a contradiction, then φp1¬p1\varphi \equiv p_1 \wedge \neg p_1, which is (a degenerate) DNF. Otherwise, for each interpretation vv with vφv \models \varphi (each true row), form the minterm

mv  =  12n,i={piif v(pi)=T,¬piif v(pi)=F.m_v \;=\; \ell_1 \wedge \ell_2 \wedge \dots \wedge \ell_n, \qquad \ell_i = \begin{cases} p_i & \text{if } v(p_i)=T,\\ \neg p_i & \text{if } v(p_i)=F. \end{cases}

By construction mvm_v is true under vv and false under every other interpretation (any other interpretation disagrees with vv on some pip_i, making that literal i\ell_i false, hence the whole conjunction false). Let D=vφmvD = \bigvee_{v \models \varphi} m_v. For any interpretation uu: if uφu \models \varphi then the disjunct mum_u is true, so DD is true; if u⊭φu \not\models \varphi then every disjunct mvm_v (with vuv \neq u, vφv\models\varphi) is false at uu, so DD is false. Hence DD has the same truth value as φ\varphi everywhere: φD\varphi \equiv D, and DD is in DNF.

CNF. Dually, if φ\varphi is a tautology then φp1¬p1\varphi \equiv p_1 \vee \neg p_1 (a degenerate CNF). Otherwise, for each interpretation vv with v⊭φv \not\models \varphi (each false row), form the maxterm

Mv  =  12n,i={¬piif v(pi)=T,piif v(pi)=F,M_v \;=\; \ell_1 \vee \ell_2 \vee \dots \vee \ell_n, \qquad \ell_i = \begin{cases} \neg p_i & \text{if } v(p_i)=T,\\ p_i & \text{if } v(p_i)=F, \end{cases}

i.e. the negation of the pattern of vv. Then MvM_v is false under vv and true under every other interpretation. Let C=v⊭φMvC = \bigwedge_{v \not\models \varphi} M_v. A symmetric argument shows φC\varphi \equiv C, and CC is in CNF. (Alternatively: apply the DNF construction to ¬φ\neg\varphi, then negate and push negations in with De Morgan — De Morgan turns the DNF of ¬φ\neg\varphi into a CNF of φ\varphi.) ∎

Corollary 6.14 (functional completeness). The set of connectives {¬,,}\{\neg, \wedge, \vee\} is functionally complete: every truth function of nn variables is computed by some formula using only ¬,,\neg, \wedge, \vee.

Proof. A truth function is a final column, i.e. the truth table of some formula; Theorem 6.13 produces an equivalent DNF (or CNF), which uses only ¬,,\neg, \wedge, \vee. ∎

Remark. Because pq¬(¬p¬q)p\wedge q \equiv \neg(\neg p\vee\neg q) and pq¬(¬p¬q)p\vee q\equiv\neg(\neg p\wedge\neg q) (De Morgan), even {¬,}\{\neg,\wedge\} and {¬,}\{\neg,\vee\} are complete; and a further reduction shows NAND alone and NOR alone are each complete (the Sheffer stroke, proved complete in print by Sheffer in 1913 and anticipated by Peirce around 1880). This is exactly why digital hardware (Lectures 4–5) can be built entirely from NAND gates.

Obtaining normal forms by rewriting

The truth-table method of Theorem 6.13 is canonical but produces large formulas. In practice one rewrites, in three stages:

  1. Eliminate \leftrightarrow and \to using pq(pq)(qp)p\leftrightarrow q\equiv(p\to q)\wedge(q\to p) and pq¬pqp\to q\equiv\neg p\vee q.
  2. Push negations inward to the atoms using De Morgan and double negation, reaching negation normal form (NNF) — where ¬\neg appears only directly on atoms.
  3. Distribute: for CNF, distribute \vee over \wedge; for DNF, distribute \wedge over \vee.

Example 6.16 (to CNF by rewriting). Convert p(qr)p \to (q \wedge r).

p(qr)¬p(qr)  (impl.)  (¬pq)(¬pr)  (distribute  over ).p\to(q\wedge r) \equiv \neg p\vee(q\wedge r) \;\text{(impl.)}\; \equiv (\neg p\vee q)\wedge(\neg p\vee r)\;\text{(distribute $\vee$ over $\wedge$).}

The result (¬pq)(¬pr)(\neg p\vee q)\wedge(\neg p\vee r) is in CNF. Meanwhile ¬p(qr)\neg p\vee(q\wedge r) is already in DNF (a disjunction of the one-literal term ¬p\neg p and the term qrq\wedge r).

Example 6.17 (to DNF by rewriting). Convert (pq)(rs)(p\vee q)\wedge(r\vee s). Distributing \wedge over \vee:

(pq)(rs)(pr)(ps)(qr)(qs),(p\vee q)\wedge(r\vee s) \equiv (p\wedge r)\vee(p\wedge s)\vee(q\wedge r)\vee(q\wedge s),

a DNF with four terms. (This one-formula example already shows how distribution can multiply out: two clauses of size 2 became four terms.)

Example 6.18 (NNF via De Morgan).

¬(p(q¬r))¬p¬(q¬r)¬p(¬q¬¬r)¬p(¬qr).\neg\big(p\wedge(q\vee\neg r)\big) \equiv \neg p\vee\neg(q\vee\neg r) \equiv \neg p\vee(\neg q\wedge\neg\neg r) \equiv \neg p\vee(\neg q\wedge r).

Negations now sit only on atoms (NNF), and the result ¬p(¬qr)\neg p\vee(\neg q\wedge r) is in DNF.

Example 6.19 (canonical forms of pqp\to q). From its truth table (T,T,F,TT,T,F,T; false only at p=T,q=Fp=T,q=F):

  • Canonical DNF (minterms for the three true rows FF,FT,TTFF, FT, TT): (¬p¬q)(¬pq)(pq)(\neg p\wedge\neg q)\vee(\neg p\wedge q)\vee(p\wedge q).
  • Canonical CNF (maxterm for the one false row TFTF): (¬pq)(\neg p\vee q).

The CNF collapses to the single clause ¬pq\neg p\vee q — precisely Theorem 6.10. This illustrates that canonical forms are correct but not minimal; minimization (Karnaugh maps, Quine–McCluskey) is the Lecture 4–5 topic.


6.11 Logical consequence and validity of arguments

We can now make precise what it means for a conclusion to follow from premises — the central notion of correct reasoning.

Definition (logical consequence / entailment). Given premises φ1,,φn\varphi_1, \dots, \varphi_n and a conclusion ψ\psi, the premises entail ψ\psi, written

φ1,,φnψ,\varphi_1, \dots, \varphi_n \models \psi,

if every interpretation that makes all the premises true also makes ψ\psi true. Equivalently: there is no interpretation (no counterexample) satisfying all premises yet falsifying ψ\psi. Read \models as “semantically entails” or “yields.”

Definition (valid argument). An argument with premises φ1,,φn\varphi_1,\dots,\varphi_n and conclusion ψ\psi is valid exactly when φ1,,φnψ\varphi_1,\dots,\varphi_n \models \psi; otherwise it is invalid, and any interpretation making all premises true and the conclusion false is a counterexample.

The following theorem reduces every entailment question to a tautology (hence, via Theorem 6.4, to a satisfiability) question — the reason a single truth-table procedure decides validity.

Theorem 6.15 (semantic deduction theorem). φ1,,φnψ\varphi_1, \dots, \varphi_n \models \psi if and only if the formula (φ1φn)ψ(\varphi_1 \wedge \dots \wedge \varphi_n) \to \psi is a tautology.

Proof. Write Φ=φ1φn\Phi = \varphi_1 \wedge \dots \wedge \varphi_n. For any interpretation vv, vˉ(Φ)=T\bar v(\Phi) = T iff vv satisfies all the premises.

(\Rightarrow) Assume φ1,,φnψ\varphi_1,\dots,\varphi_n \models \psi. Take any vv. If vˉ(Φ)=F\bar v(\Phi) = F, then vˉ(Φψ)=T\bar v(\Phi \to \psi) = T (implication with false antecedent). If vˉ(Φ)=T\bar v(\Phi) = T, then vv satisfies all premises, so by entailment vˉ(ψ)=T\bar v(\psi) = T, whence vˉ(Φψ)=T\bar v(\Phi \to \psi) = T. Either way Φψ\Phi\to\psi is true under vv; as vv was arbitrary, Φψ\Phi \to \psi is a tautology.

(\Leftarrow) Assume Φψ\Phi \to \psi is a tautology. Let vv satisfy all premises, so vˉ(Φ)=T\bar v(\Phi) = T. Since vˉ(Φψ)=T\bar v(\Phi \to \psi) = T and the antecedent is true, the consequent vˉ(ψ)=T\bar v(\psi) = T. Thus every model of all premises is a model of ψ\psi, i.e. φ1,,φnψ\varphi_1,\dots,\varphi_n\models\psi. ∎

Theorem 6.16 (entailment via unsatisfiability — refutation). φ1,,φnψ\varphi_1, \dots, \varphi_n \models \psi if and only if {φ1,,φn,¬ψ}\{\varphi_1, \dots, \varphi_n, \neg\psi\} is jointly unsatisfiable.

Proof. φ1,,φnψ\varphi_1,\dots,\varphi_n\models\psi fails iff some vv satisfies all φi\varphi_i but not ψ\psi, i.e. satisfies all φi\varphi_i and ¬ψ\neg\psi — i.e. iff {φ1,,φn,¬ψ}\{\varphi_1,\dots,\varphi_n,\neg\psi\} is jointly satisfiable. Negating both sides gives the claim. ∎

Remark (why refutation matters). Theorem 6.16 is how automated reasoners actually test entailment: to check Γψ\Gamma \models \psi, throw ¬ψ\neg\psi in with the premises and ask a SAT solver whether the result is unsatisfiable. “Unsatisfiable” is the proof. This is the semantic seed of the proof by contradiction technique you will meet in Lecture 7.

Common pitfall (validity ≠ true premises). Validity is about form — the transmission of truth — not about whether the premises are actually true. A valid argument can have false premises and a false conclusion; validity only guarantees that if the premises are true, the conclusion must be. Conversely, an argument can have a true conclusion yet be invalid (the conclusion just happens to hold, not because the premises force it).

Worked validity checks

The truth-table test for φ1,,φnψ\varphi_1,\dots,\varphi_n\models\psi: build one table; scan only the rows where all premises are true; the argument is valid iff the conclusion is true in every such row.

Validity check: in every row where all premises are true, the conclusion is also true

Example 6.20 (modus ponens — valid). “If it rains, the ground is wet. It rains. Therefore the ground is wet.” Let pp = “it rains”, qq = “the ground is wet”. Premises pq,  pp\to q,\; p; conclusion qq.

pp qq pqp\to q pp qq
F F T F F
F T T F T
T F F T F
T T T T T

Both premises are true only in the last row, where the conclusion qq is also true. No counterexample \Rightarrow valid. (Reached purely by inspecting truth values; the name “modus ponens” and its use as a derivation rule belong to Lecture 7.)

Example 6.21 (affirming the consequent — invalid). “If it rains, the ground is wet. The ground is wet. Therefore it rains.” Premises pq,  qp\to q,\; q; conclusion pp. The row p=F,q=Tp=F, q=T makes both premises true (pq=Tp\to q = T, q=Tq = T) yet the conclusion p=Fp = F. That is a counterexample, so {pq, q}⊭p\{p\to q,\ q\} \not\models pinvalid, despite its surface resemblance to Example 6.20.

Example 6.22 (hypothetical syllogism — valid). {pq,  qr}pr\{p\to q,\; q\to r\} \models p\to r.

pp qq rr pqp\to q qrq\to r prp\to r
F F F T T T
F F T T T T
F T F T F T
F T T T T T
T F F F T F
T F T F T T
T T F T F F
T T T T T T

Both premises are true in rows 1, 2, 4, 8; in each of those the conclusion prp\to r is true. No counterexample \Rightarrow valid.

Example 6.23 (modus tollens — valid). {pq,  ¬q}¬p\{p\to q,\; \neg q\} \models \neg p.

pp qq pqp\to q ¬q\neg q ¬p\neg p
F F T T T
F T T F T
T F F T F
T T T F F

Both premises true only in row 1, where ¬p=T\neg p = T. Valid. Contrast denying the antecedent {pq, ¬p}¬q\{p\to q,\ \neg p\}\models\neg q: rows p=Fp=F make both premises true, but at p=F,q=Tp=F, q=T the conclusion ¬q=F\neg q=F — a counterexample, so that pattern is invalid.

Example 6.24 (the deploy argument, Example 6.7). Premises (ct)d,  ¬d,  t(c\wedge t)\to d,\; \neg d,\; t; conclusion ¬c\neg c. Suppose all premises hold: ¬d\neg d gives d=Fd=F; tt gives t=Tt=T. If cc were TT, then ct=Tc\wedge t = T, and the first premise would force d=Td=T, contradicting d=Fd=F. So c=Fc=F, i.e. ¬c=T\neg c=T. Every model of the premises satisfies the conclusion — valid. (This informal case analysis is exactly what a truth table verifies row by row, and what Theorem 6.15 packages as the tautology ((ct)d)¬dt¬c\big((c\wedge t)\to d\big)\wedge\neg d\wedge t\to\neg c.)

The same truth-table method thus does triple duty in this lecture: it classifies a single formula (§6.7), it tests equivalence of two formulas by comparing final columns (§6.9), and it tests validity of an argument by scanning for a counterexample row (§6.11).


6.12 Semantics versus proof theory (a bridge to Lecture 7)

Everything above is semantic: truth values, interpretations, truth tables, and the entailment symbol \models. We answered “does ψ\psi follow from Γ\Gamma?” by checking all interpretations.

Lecture 7 takes the complementary, proof-theoretic (syntactic) route. It fixes a small stock of rules of inference — modus ponens (“from φ\varphi and φψ\varphi\to\psi, infer ψ\psi”), modus tollens, disjunctive syllogism, and so on — and defines a derivation Γψ\Gamma \vdash \psi as a finite chain of formulas, each an axiom, a premise, or the result of applying a rule to earlier lines. Here nothing is “true” or “false”; formulas are manipulated by rules, mechanically, like moves in a game.

Semantics (this lecture) Proof theory (Lecture 7)
Central relation Γψ\Gamma \models \psi (entailment) Γψ\Gamma \vdash \psi (derivability)
Basic object truth value, interpretation inference rule, derivation
Method truth tables / model search rule application / proof construction
Question answered is it true in all models? can it be derived?

The two views are connected by two deep meta-theorems, which the course states (and Lecture 7 uses) but which are proved in a dedicated logic course:

  • Soundness: if Γψ\Gamma \vdash \psi then Γψ\Gamma \models \psi (the rules never derive a falsehood from truths — proofs are trustworthy).
  • Completeness (Gödel, 1929/30, for first-order; the propositional case is Post, 1921): if Γψ\Gamma \models \psi then Γψ\Gamma \vdash \psi (every genuine entailment can be derived — the rules are enough).

Together, for propositional logic, \vdash and \models coincide: derivability and entailment are the same relation, approached from two directions. That is why the proof techniques of Lecture 7 are correct (soundness) and sufficient (completeness) for exactly the semantic facts established here.


Historical note

The algebraic treatment of logic began with George Boole, whose The Mathematical Analysis of Logic (1847) and An Investigation of the Laws of Thought (1854) reduced reasoning to calculation on the symbols 00 and 11 — the origin of “Boolean algebra” (Lectures 4–5). Augustus De Morgan, Boole’s contemporary, gave the duality laws that bear his name. Gottlob Frege’s Begriffsschrift (1879) introduced a rigorous formal language with a precise notion of well-formed formula, launching modern mathematical logic and the syntax/semantics distinction of §6.5–§6.6. The truth table as a systematic device is usually credited to Ludwig Wittgenstein (Tractatus, 1921) and Emil Post (1921) independently, with earlier anticipations by Charles S. Peirce; Post also proved the first functional-completeness results. Jan Łukasiewicz devised parenthesis-free “Polish notation,” reminding us that unique readability (Theorem 6.1) can be achieved by grammar alone. In computer science, Claude Shannon’s 1937 master’s thesis identified propositional logic with switching circuits — the direct ancestor of Lectures 4–5 — and Stephen Cook (1971), with Leonid Levin independently, proved SAT NP-complete, placing propositional satisfiability at the very center of computational complexity.


Chapter summary

  • A proposition/statement is a declarative sentence with a definite truth value in {T,F}\{T, F\}. Questions, commands, exclamations, paradoxical sentences, and open sentences like “XX is divisible by 55” are not propositions.
  • Atoms are indivisible simple sentences (propositional variables). Compound propositions are built from atoms with ¬,,,,\neg, \wedge, \vee, \to, \leftrightarrow and are truth-functional: their value depends only on the atoms’ values and the connectives.
  • Key connective facts: \vee is inclusive; pqp\to q is false only when p=T,q=Fp=T, q=F (vacuously true when p=Fp=F); pqp\to q is equivalent to its contrapositive but not its converse or inverse.
  • Syntax defines well-formed formulas by recursion; precedence ¬>>>>\neg > \wedge > \vee > \to > \leftrightarrow and parentheses fix a unique parse tree with a main connective. Unique Readability (Theorem 6.1) guarantees exactly one parse.
  • Semantics: an interpretation assigns values to atoms and extends uniquely to all formulas (Theorem 6.2); vφv \models \varphi means φ\varphi is true under vv. A formula with nn atoms has 2n2^n interpretations — the rows of its truth table.
  • Every formula is a tautology (always TT; φ\models\varphi), a contradiction (always FF), or a contingency (mixed). It is satisfiable iff some interpretation makes it true. φ\varphi is a tautology iff ¬φ\neg\varphi is unsatisfiable (Theorem 6.4).
  • SAT — deciding satisfiability — is the first NP-complete problem (Cook–Levin); truth tables solve it in 2n2^n steps, while real SAT solvers (DPLL/CDCL) scale to millions of variables and power verification, planning, and analysis tools.
  • Logical equivalence φψ\varphi\equiv\psi (equal columns; equivalently φψ\varphi\leftrightarrow\psi a tautology, Theorem 6.5) is an equivalence relation and supports substitution (Theorem 6.6). The laws — double negation, De Morgan, distributivity, pq¬pqp\to q\equiv\neg p\vee q, contrapositive, biconditional — are proved by truth tables (Theorems 6.7–6.12) and are the semantic twins of the Boolean-algebra laws of Lecture 4.
  • Every formula has an equivalent DNF and CNF (Theorem 6.13), obtained canonically from the truth table or by rewriting (eliminate ,\to,\leftrightarrow; push ¬\neg inward to NNF; distribute). Consequently {¬,,}\{\neg,\wedge,\vee\} is functionally complete (Corollary 6.14).
  • Entailment Γψ\Gamma \models \psi holds when every model of Γ\Gamma is a model of ψ\psi; an argument is valid iff there is no counterexample row, iff (premises \to conclusion) is a tautology (Theorem 6.15), iff Γ{¬ψ}\Gamma\cup\{\neg\psi\} is unsatisfiable (Theorem 6.16).
  • This lecture is about meaning and truth (\models); deriving consequences with rules of inference (\vdash) and proof techniques is Lecture 7, tied back by soundness and completeness.

Exercises

Warm-up

  1. Decide which are propositions; for those that are, give the truth value if known. (a) 1313 is prime.” (b) “Solve the equation x2=4x^2 = 4.” (c) x2=4x^2 = 4.” (d) “Every even integer >2> 2 is a sum of two primes.” (e) “This exercise is hard!”
  2. Write the negation, converse, inverse, and contrapositive of “If a number is divisible by 66, then it is divisible by 33.” Which of the four is guaranteed to have the same truth value as the original?
  3. Insert full parentheses according to the precedence rules and identify the main connective: (a) ¬pqr\neg p \vee q \to r; (b) p¬qrsp \wedge \neg q \leftrightarrow r \vee s; (c) ¬(pq)r\neg(p \to q) \wedge r.
  4. Build the truth table of p(q¬p)p \to (q \vee \neg p) and classify it (tautology / contradiction / contingency).
  5. Translate into symbols with stated atoms: (a) “I will go running unless it snows.” (b) “You may enter only if you have a ticket.” (c) “Neither the printer nor the scanner works.”

Standard

  1. Build the truth table of (pq)(pq)(p \leftrightarrow q) \to (p \wedge q) and classify it. On which interpretations is it false?
  2. Prove by truth table that p(qr)(pq)(pr)p \vee (q \wedge r) \equiv (p \vee q) \wedge (p \vee r) (the second distributive law).
  3. Using equivalence laws only (cite each step, no truth table), simplify: (a) ¬(p¬q)\neg(p \vee \neg q); (b) ¬(¬pq)q\neg(\neg p \wedge q) \vee q; (c) (pq)(p¬q)(p \to q) \wedge (p \to \neg q).
  4. Show that {pq,  pr,  qr}r\{p \vee q,\; p \to r,\; q \to r\} \models r (constructive-dilemma pattern). Use a truth table or a short case argument, and identify the rows where all premises hold.
  5. Determine, with a truth table, whether the argument is valid: “If the cache is warm, the request is fast. The request is not fast. Therefore the cache is not warm.”
  6. Find a DNF and a CNF for pqp \oplus q (exclusive-or) and for pqp \leftrightarrow q. (You may read them off truth tables.)
  7. Convert to CNF by rewriting (show stages):   (pq)(r¬s)\;(p \wedge q) \to (r \vee \neg s).
  8. Is {pq,  ¬pr,  ¬q}r\{p \to q,\; \neg p \to r,\; \neg q\} \models r? Justify by finding all models of the premises and checking the conclusion.
  9. Show that p(qr)(pq)rp \to (q \to r) \equiv (p \wedge q) \to r (the “exportation” law) by any method, and explain why this does not contradict the non-equivalence of (pq)r(p\to q)\to r and p(qr)p\to(q\to r) from §6.5.

Challenge

  1. (Unique readability in action.) Explain why the string pqrp \wedge q \vee r needs the precedence convention to be read, and exhibit the two different fully parenthesized WFFs it could abbreviate. Show by truth table that they are not equivalent, so the convention (not mere taste) is doing real work.
  2. (Functional completeness.) Show that {¬,}\{\neg, \to\} is functionally complete by expressing \vee, \wedge, and FF using only ¬\neg and \to. (Hint: start from pq¬pqp \vee q \equiv \neg p \to q.)
  3. (NAND.) Let pq¬(pq)p \uparrow q \equiv \neg(p \wedge q). Express ¬p\neg p, pqp \wedge q, and pqp \vee q using only \uparrow, thereby proving NAND is functionally complete by itself.
  4. (Refutation.) Use Theorem 6.16 to test {pq,  qr,  p}r\{p \to q,\; q \to r,\; p\} \models r: write the set {pq, qr, p, ¬r}\{p\to q,\ q\to r,\ p,\ \neg r\}, argue it is unsatisfiable, and explain how “unsatisfiable” certifies the entailment.
  5. (Compactness of the method, and its cost.) A formula has nn distinct atoms. (a) How many rows does its truth table have? (b) Explain why deciding satisfiability by truth table is impractical for n=60n = 60, giving the approximate row count. (c) State in one sentence what a SAT solver does differently.
  6. (Modeling.) Three suspects A,B,CA, B, C are questioned. AA says “BB did it.” BB says “I didn’t do it.” CC says “I didn’t do it.” Exactly one suspect is guilty and exactly one statement is true. Introduce atoms for guilt, encode the constraints as a propositional formula, and determine the guilty party.

Selected answers & hints

1. (a) proposition, true. (b) not a proposition (imperative). (c) open sentence — a proposition only once xx is fixed. (d) proposition (this is Goldbach’s conjecture — its truth value is unknown, but it has one). (e) not a proposition (exclamation, and subjective).

2. Original dtd\to t (“divisible by 66\to “divisible by 33”). Negation: d¬td \wedge \neg t. Converse: tdt \to d. Inverse: ¬d¬t\neg d \to \neg t. Contrapositive: ¬t¬d\neg t \to \neg d. Only the contrapositive is guaranteed equivalent (Theorem 6.11); the original is true here, its contrapositive true, but its converse (“divisible by 33 \Rightarrow divisible by 66”) is false (99 is a counterexample).

3. (a) (((¬p)q)r)(((\neg p)\vee q)\to r), main connective \to. (b) ((p(¬q))(rs))((p\wedge(\neg q))\leftrightarrow(r\vee s)), main connective \leftrightarrow. (c) ((¬(pq))r)((\neg(p\to q))\wedge r), main connective \wedge.

4. p(q¬p)p\to(q\vee\neg p): the column is T,T,F,TT,T,F,T — a contingency, false only at p=T,q=Fp=T, q=F (there q¬p=FF=Fq\vee\neg p = F\vee F = F, so TF=FT\to F = F; when p=Fp=F the implication is vacuously true, and when p=q=Tp=q=T the consequent is true).

5. (a) ¬sr\neg s \to r, i.e. srs \vee r, with rr=“I run”, ss=“it snows”. (b) ete \to t (“only if” \Rightarrow antecedent is enter), ee=“enter”, tt=“have ticket”. (c) ¬p¬s¬(ps)\neg p \wedge \neg s \equiv \neg(p\vee s).

6. False exactly when pqp \leftrightarrow q is true but pqp\wedge q is false — i.e. the row p=F,q=Fp=F, q=F (there pq=Tp\leftrightarrow q=T, pq=Fp\wedge q=F). So it is a contingency, false only at p=q=Fp=q=F.

8. (a) ¬pq\neg p \wedge q (De Morgan then double negation). (b) ¬(¬pq)q(p¬q)qp(¬qq)pTT\neg(\neg p\wedge q)\vee q \equiv (p\vee\neg q)\vee q \equiv p\vee(\neg q\vee q)\equiv p\vee T\equiv T — a tautology. (c) (pq)(p¬q)(¬pq)(¬p¬q)¬p(q¬q)¬pF¬p(p\to q)\wedge(p\to\neg q)\equiv(\neg p\vee q)\wedge(\neg p\vee\neg q)\equiv \neg p\vee(q\wedge\neg q)\equiv\neg p\vee F\equiv\neg p.

9. Valid. In any row where pqp\vee q is true, at least one of p,qp, q holds; together with prp\to r / qrq\to r that forces rr. No row has all three premises true and rr false.

10. Valid — this is modus tollens (wf, ¬f¬ww\to f,\ \neg f \models \neg w); cf. Example 6.23.

11. pqp\oplus q: DNF (¬pq)(p¬q)(\neg p\wedge q)\vee(p\wedge\neg q); CNF (pq)(¬p¬q)(p\vee q)\wedge(\neg p\vee\neg q).   pq\;p\leftrightarrow q: DNF (pq)(¬p¬q)(p\wedge q)\vee(\neg p\wedge\neg q); CNF (p¬q)(¬pq)(p\vee\neg q)\wedge(\neg p\vee q).

12. (pq)(r¬s)¬(pq)(r¬s)(¬p¬q)r¬s¬p¬qr¬s(p\wedge q)\to(r\vee\neg s)\equiv\neg(p\wedge q)\vee(r\vee\neg s)\equiv(\neg p\vee\neg q)\vee r\vee\neg s\equiv \neg p\vee\neg q\vee r\vee\neg s — a single clause, already CNF.

14. Both sides equal ¬p¬qr\neg p\vee\neg q\vee r (rewrite each with the implication law and associate). No contradiction with §6.5: there we compared (pq)r(p\to q)\to r with p(qr)p\to(q\to r)different left-hand sides — whereas here the left side is the conjunction pqp\wedge q, not the implication pqp\to q.

15. It could abbreviate ((pq)r)((p\wedge q)\vee r) or (p(qr))(p\wedge(q\vee r)). Truth tables differ (e.g. p=F,q=F,r=Tp=F, q=F, r=T: the first is TT, the second is FF). The convention >\wedge > \vee selects the first reading; without it the string would be ambiguous.

16. Using only {¬,}\{\neg,\to\}:   pq¬pq  \;p\vee q\equiv\neg p\to q\; (since ¬pq¬¬pqpq\neg p\to q\equiv\neg\neg p\vee q\equiv p\vee q);   pq¬(p¬q)\;p\wedge q\equiv\neg(p\to\neg q); and a contradiction F¬(pp)F\equiv\neg(p\to p) (as ppp\to p is a tautology). Having reconstructed ¬,,\neg,\vee,\wedge, Corollary 6.14 finishes completeness.

17. ¬ppp\neg p\equiv p\uparrow p;   pq(pq)(pq)\;p\wedge q\equiv(p\uparrow q)\uparrow(p\uparrow q);   pq(pp)(qq)\;p\vee q\equiv(p\uparrow p)\uparrow(q\uparrow q). (Verify each by a 22- or 44-row table.)

18. From pp and pqp\to q we need qq; from qq and qrq\to r we need rr; but ¬r\neg r demands r=Fr=F — no interpretation satisfies all four, so the set is unsatisfiable, which by Theorem 6.16 certifies {pq,qr,p}r\{p\to q, q\to r, p\}\models r (this is two chained modus-ponens steps, a.k.a. the transitivity of \to).

19. (a) 2n2^n. (b) 2601.15×10182^{60}\approx 1.15\times 10^{18} rows — beyond any feasible enumeration. (c) A SAT solver searches assignments intelligently (unit propagation, conflict-driven clause learning), pruning the space instead of listing all 2n2^n rows.

20. Let gA,gB,gCg_A, g_B, g_C mean “AA/BB/CC is guilty.” Statements: SA=gBS_A = g_B,   SB=¬gB\;S_B = \neg g_B,   SC=¬gC\;S_C = \neg g_C. Constraints: exactly one of gA,gB,gCg_A, g_B, g_C is true (guilt) and exactly one of SA,SB,SCS_A, S_B, S_C is true (truth). Now SAS_A and SBS_B are negations of each other, so exactly one of them is true no matter what; since only one statement in total may be true, SCS_C must be false. Then SC=¬gC=FS_C = \neg g_C = F gives gC=Tg_C = T, so CC is guilty, and exactly-one-guilty forces A,BA, B innocent. Check: with gC=T,gA=gB=Fg_C=T, g_A=g_B=F we get SA=F,SB=T,SC=FS_A=F, S_B=T, S_C=F — exactly one true statement (SBS_B). The model is unique. C did it.


Further reading

  • K. H. Rosen, Discrete Mathematics and Its Applications — Chapter 1, “The Foundations: Logic and Proofs,” especially §1.1 (propositional logic), §1.2 (applications), §1.3 (propositional equivalences). The standard CS-oriented treatment, with many translation and circuit examples.
  • S. S. Epp, Discrete Mathematics with Applications — Chapter 2, “The Logic of Compound Statements” (statements, connectives, truth tables, logical equivalence, conditionals, valid arguments). Especially clear on natural-language translation and the converse/inverse/contrapositive distinctions.
  • H. B. Enderton, A Mathematical Introduction to Logic — Chapter 1, for the rigorous syntax/semantics development (unique readability, the valuation theorem, functional completeness) at the level of §6.5–§6.6 and §6.10.
  • M. Huth & M. Ryan, Logic in Computer Science: Modelling and Reasoning about Systems — for CNF, SAT/DPLL, and the verification applications sketched in §6.8.
  • Cross-references within this course: Lectures 4–5 (Boolean algebra and logic circuits — the same algebra, read algebraically) and Lecture 7 (rules of inference and proof techniques — the syntactic counterpart, \vdash, to this lecture’s \models).

Lectures/CDM-L06.md · 71.9 KB · updated 2026-08-01 20:48