4.9  Normal Forms and Adequate Connectives

The proof of completeness wrote each row of a truth table as a list of signed atoms p1v,…,pnv (Section 4.8). Join the signed atoms of one row by ∧, and you get a formula that is true in that row and in no other. Join those formulas, one for each row where a given formula φ is true, by ∨, and you get a formula with the same truth table as φ. This section turns that observation into two standard shapes for formulas, the disjunctive and the conjunctive normal form. It then reads validity off the conjunctive shape at a glance, and asks how few connectives are really needed.

On a first reading this section may wait: it is a second-pass section, and nothing in Chapters 5–8 uses it.

4.9.1. Conjunctions and disjunctions of many formulas

Normal forms are long conjunctions and disjunctions. Section 4.5 fixed how to write them, in the paragraph on long conjunctions after Proposition 4.5.1. For formulas χ1,…,χk with k≥1, χ1∧χ2∧⋯∧χk is the conjunction grouped to the right, χ1∧(χ2∧(⋯∧χk)), and likewise for ∨; for k=1 it is χ1 itself. That paragraph proved, by induction on the number of terms, how such formulas are evaluated: for every valuation v,

v(χ1∧⋯∧χk)=T⟺v(χi)=T for every i=1,…,k,v(χ1∨⋯∨χk)=T⟺v(χi)=T for some i=1,…,k.
(4.9.1)

We use these two lines constantly below, and we cite them by this display.

So a long conjunction is true when all its parts are, and a long disjunction when at least one is, just as the words say.

4.9.2. Literals, clauses and the two normal forms

The building blocks are the smallest formulas that still carry a sign.

Definition 4.9.1 (Literal)

A literal is an atom or the negation of an atom.

So p, ¬p, q7 and ¬q7 are literals. The signed atom pv of Section 4.8 is always a literal. The formulas ¬¬p, ¬(p∧q) and ⊥ are not: in the first two, ¬ is applied to something other than an atom, and ⊥ is neither an atom nor a negation. The opposite of a literal is ¬p if the literal is p, and p if it is ¬p. By the clause for ¬ in Definition 4.4.2, a literal and its opposite take opposite values under every valuation.

From literals we build two kinds of blocks and two kinds of formulas.

  • A clause joins one or more literals by ∨, such as p∨¬q∨r, or ¬q alone.
  • A conjunctive clause joins one or more literals by ∧, such as p∧¬q∧r, or ¬q alone. (We do not shorten it to “conjunct”, which keeps its ordinary meaning, one side of a conjunction.)

A normal form is a formula whose connectives come in fixed layers: negations only on atoms, then one layer of one connective, then one layer of the other.

Definition 4.9.2 (Disjunctive Normal Form)

A formula has disjunctive normal form (DNF), or is in DNF, when it has the shape C1∨⋯∨Ck, with k≥1, where every Ci joins one or more literals by ∧.

Definition 4.9.3 (Conjunctive Normal Form)

A formula has conjunctive normal form (CNF), or is in CNF, when it has the shape K1∧⋯∧Kk, with k≥1, where every Ki joins one or more literals by ∨.

In words: a DNF is an “or of ands” and a CNF an “and of ors”, and in both the only negations sit directly on atoms. Read a DNF as a list of situations, any one of which makes it true; read a CNF as a list of requirements, all of which must be met.

Check some formulas against the definitions, clause by clause.

  1. (p∧¬q)∨(¬p∧q) is in DNF: two conjunctive clauses, each a conjunction of literals. It is not in CNF: as a conjunction of clauses it would have to be a single clause (it is not a conjunction), and a clause cannot contain ∧.
  2. (p∨q)∧(¬p∨¬q) is in CNF, with two clauses, and not in DNF.
  3. p∧¬q is in both: in DNF with one conjunctive clause, and in CNF with two clauses of one literal each. Likewise p∨¬q is in both.
  4. A single literal, ¬r, is in both forms: one conjunctive clause of one literal, and one clause of one literal. This degenerate case matters, because a formula such as ¬r must count as already normal.

A nonexample by a minimal change: (p∧¬q)∨r is in DNF, but ¬(p∧q)∨r is not in either form. Only one symbol moved, and the literal condition fails: ¬ now stands on the conjunction p∧q, not on an atom. The formula p→q is in neither form either, since → is not allowed at all.

Why these layers? Because they are the shapes that the truth table hands us, as the next theorem shows, and because in these shapes some questions become easy: the subsection “Reading validity off a CNF” below decides validity of a CNF without a table.

Warning. A literal is an atom with at most one ¬, and nothing else. ¬¬p is equivalent to the literal p but is not a literal, so ¬¬p∨q is not in CNF as written. Likewise ⊥ is not a literal, so a “normal form” containing ⊥ is not one; that is why the constructions below never use it.

Quick check. Which of the following are in CNF, and which are in DNF? (i) (p∨¬q)∧r; (ii) ¬(p∨q); (iii) p∨(¬q∧r).

Solution. (i) CNF, with clauses p∨¬q and r; not DNF, since the conjunctive clause would have to be the whole formula and p∨¬q is not a literal. (ii) Neither: ¬ stands on a disjunction. (iii) DNF, with conjunctive clauses p and ¬q∧r; not CNF, since the one clause would contain ∧.

4.9.3. Reading a DNF off the truth table

Take a valuation v and atoms p1,…,pn with n≥1, and form the minterm of the row of v, the conjunctive clause of its signed atoms, Cv:=p1v∧⋯∧pnv. For every valuation w, each piv is true under w exactly when w(pi)=v(pi): if v(pi)=T, then piv=pi; if v(pi)=F, then piv=¬pi, which is true under w exactly when w(pi)=F. By Eq. 4.9.1,

w(Cv)=T⟺w(pi)=v(pi) for every i=1,…,n.
(4.9.2)

So Cv is true in the row of v and in no other row. It is a formula that “names” one row.

Example (Exactly one of two)

Find a formula in DNF that is true exactly when exactly one of p, q is true, and check it.

Solution. The rows with exactly one of p, q true are (p,q)=(T,F) and (F,T). Their minterms are p∧¬q and ¬p∧q, so the answer is (p∧¬q)∨(¬p∧q). Check against the table: in the row T, F the first minterm is true; in F, T the second is; in T, T each minterm has a false literal (¬q, ¬p); in F, F likewise (p, q). So the formula is true in exactly the two rows wanted.

The same recipe works for any formula.

Theorem 4.9.1 (Disjunctive Normal Form)

Every formula φ is equivalent to a formula in DNF. If φ has at least one atom, the DNF can be chosen so that every atom in it is an atom of φ.

Idea. List the rows where φ is true and disjoin their minterms Cv. A valuation makes the disjunction true exactly when it agrees with one of those rows, which by Lemma 4.4.1 is exactly when it makes φ true. Two degenerate cases need a convention: a formula with no T-row, whose disjunction would be empty, and a formula with no atoms, which has no rows to speak of.

Proof. By the paraphrase of Definition 4.5.4, two formulas φ and ψ are equivalent exactly when v(φ)=v(ψ) for every valuation v.

Case 1: φ has at least one atom. Let p1,…,pn (n≥1) be the atoms of φ. A row is a choice of a value for each pi; there are 2n rows, and for each we fix a valuation that takes those values at p1,…,pn (and, say, T at every other atom). By Lemma 4.4.1, v(φ) depends only on the row of v. Let v1,…,vk be the fixed valuations of the rows in which φ is T.

If k≥1, let D:=Cv1∨⋯∨Cvk, which is in DNF by Definition 4.9.2, with atoms among p1,…,pn. Let w be any valuation. By Eq. 4.9.1 and Eq. 4.9.2, w(D)=T exactly when w agrees with some vj on p1,…,pn. If it does, then w(φ)=vj(φ)=T by Lemma 4.4.1. Conversely, if w(φ)=T, then the row of w is one where φ is T, so w agrees on p1,…,pn with the valuation vj fixed for that row. Hence w(D)=w(φ) for every w, and φ≡D.

If k=0, then φ is F in every row, hence under every valuation. The formula p1∧¬p1 is in DNF (one conjunctive clause of two literals) and is F under every valuation by Definition 4.4.2. So φ≡p1∧¬p1.

Case 2: φ has no atoms. Any two valuations agree on all the atoms of φ (there are none), so by Lemma 4.4.1 v(φ) is the same for every v. Let p be an atom. If that value is T, then φ≡p∨¬p, which is true under every valuation and is in DNF (two conjunctive clauses of one literal); if it is F, then φ≡p∧¬p. This proves the theorem.

The minterms of different rows are never true together, and in each row exactly one of the 2n minterms is true: they divide the rows like the pieces of a partition, and a full disjunctive normal form collects the pieces in which the formula is true.

The minterms Cv are the signed atoms of Section 4.8 joined by ∧. There the signed atoms of a row were premises from which φv was derived; here they are joined into a formula that is true in that row only. The proof is the proof of completeness with the derivations taken out.

Second readingWhy not the constant for contradiction

For p∧¬p we could have written ⊥, which is also F under every valuation. We did not, because ⊥ is not a literal, and because the adequacy theorem at the end of this section reuses the construction in a language without ⊥.

4.9.4. Conjunctive normal form

A DNF lists the rows where a formula is true. A CNF does the opposite: it lists the rows where the formula is false, one clause per row, each clause being false in its row and true in every other.

Theorem 4.9.2 (Conjunctive Normal Form)

Every formula φ is equivalent to a formula in CNF. If φ has at least one atom, the CNF can be chosen so that every atom in it is an atom of φ.

Idea. Apply Theorem 4.9.1 to ¬φ and negate the result: φ≡¬¬φ≡¬(C1∨⋯∨Ck). Now push the ¬ inwards with De Morgan’s laws and double negation (Proposition 4.5.1): ¬(C1∨⋯∨Ck) becomes ¬C1∧⋯∧¬Ck, and each ¬Ci, the negation of a conjunction of literals, becomes the disjunction of the opposite literals. The proof checks the outcome directly with Eq. 4.9.1, which avoids De Morgan’s laws for many terms.

Proof. By Theorem 4.9.1, ¬φ≡C1∨⋯∨Ck for some conjunctive clauses C1,…,Ck (with atoms among those of φ if it has any, since ¬φ has the same atoms). For each i, let Ki be the disjunction of the opposites of the literals of Ci, in the same order, and let K:=K1∧⋯∧Kk. Then K is in CNF, with the same atoms as C1∨⋯∨Ck.

Let w be a valuation. Each literal of Ki is true under w exactly when the corresponding literal of Ci is false. By Eq. 4.9.1, used at each step: w(K)=T⟺for every i, w(Ki)=T⟺for every i, some literal of Ci is false under w⟺for every i, w(Ci)=F⟺w(C1∨⋯∨Ck)=F. Since C1∨⋯∨Ck≡¬φ, the last line holds exactly when w(¬φ)=F, that is, when w(φ)=T. So w(K)=w(φ) for every w, and φ≡K.

Unwinding the construction: the conjunctive clauses Ci of the DNF of ¬φ are the rows where φ is false, and Ki is the clause that is false exactly in the row of Ci. So the CNF can be read straight off the table: one clause per F-row, built from the opposites of that row’s signed atoms. In the row p=T, q=F, for instance, the clause is ¬p∨q. A formula with no F-row gets, by the proof, the clause of a contradiction’s DNF negated, ¬p∨p (from C1=p∧¬p), which is true in every row.

Quick check. On the atoms p, q, r, write the CNF clause for the F-row p=F, q=T, r=F.

Solution. The row’s signed atoms are ¬p, q, ¬r; their opposites give p∨¬q∨r. It is false exactly when p is F, q is T and r is F, that is, in that row only.

Alternatively, a CNF can be reached by rewriting. First replace each ⊥, which is not a literal, by p∧¬p for an atom p; both are false in every row. Replace α↔β by (α→β)∧(β→α) and α→β by ¬α∨β; push each ¬ inwards by De Morgan’s laws, and remove ¬¬; finally distribute ∨ over ∧, replacing α∨(β∧γ) by (α∨β)∧(α∨γ). Each step replaces a part of the formula by an equivalent one: the equivalences are ⊥≡p∧¬p and those of Proposition 4.5.1, which hold for arbitrary formulas, and Lemma 4.5.2 says the whole formula stays equivalent; since ≡ is transitive (Section 4.5), the steps chain. Stopping before the distribution step, and distributing ∧ over ∨ instead, gives a DNF. The rewriting route is often much shorter than the table, as the next example shows, but it can also explode, as the warning after it shows.

Example (Two routes to a normal form)

Put φ=(p→q)→(¬q→r) into DNF and into CNF, first from its truth table and then by rewriting.

Solution. The table route. Work backwards from F (Section 4.4): φ is false exactly when p→q is T and ¬q→r is F. The latter needs ¬q true and r false, so q=r=F; then p→q true needs p=F. So φ has exactly one F-row, p=q=r=F, as the table confirms: pqrp→q¬q→r(p→q)→(¬q→r)TTTTTTTTFTTTTFTFTTTFFFFTFTTTTTFTFTTTFFTTTTFFFTFF The DNF of Theorem 4.9.1 has one minterm for each of the seven T-rows: (p∧q∧r)∨(p∧q∧¬r)∨(p∧¬q∧r)∨(p∧¬q∧¬r)∨(¬p∧q∧r)∨(¬p∧q∧¬r)∨(¬p∧¬q∧r). The CNF of Theorem 4.9.2 has one clause for the single F-row, built from the opposites of ¬p,¬q,¬r: it is the single clause p∨q∨r.

The rewriting route. Eliminate the three implications, then push the negation in: φ≡¬(¬p∨q)∨(¬¬q∨r)≡(¬¬p∧¬q)∨(q∨r)≡(p∧¬q)∨q∨r, using (c) of Proposition 4.5.1 three times, then De Morgan’s law (b) for ¬(α∨β), then double negation (d) twice. This is already a DNF, with three conjunctive clauses. For a CNF, distribute, by (g) together with commutativity (f) and associativity (h): (p∧¬q)∨(q∨r)≡(p∨q∨r)∧(¬q∨q∨r). The second clause contains q and ¬q, so it is true in every row, and a conjunction with a part that is true in every row is equivalent to its other part. So φ≡p∨q∨r: one clause, as the table route found.

The formula p∨q∨r is also a DNF, with three conjunctive clauses of one literal each. So the table’s seven minterms and the rewriting’s three conjunctive clauses can both be replaced by three one-literal conjunctive clauses. Both routes are correct; they differ in length, and neither is guaranteed to give the shortest normal form.

Warning. A formula has many equivalent CNFs and DNFs; “normal form” does not mean “unique form”. p∨q∨r and (p∨q∨r)∧(¬q∨q∨r) are both CNFs of the formula above. And the two routes have opposite weaknesses. The table route needs all 2n rows for n atoms. The rewriting route can explode at the distribution step: distributing (p1∧q1)∨(p2∧q2)∨(p3∧q3) gives 8 clauses, one for each way of picking pi or qi from every conjunctive clause, and m such conjunctive clauses give 2m clauses.

4.9.5. Reading validity off a CNF

A CNF is a list of requirements, all of which must hold. That makes one question easy.

Proposition 4.9.3 (Validity of a CNF)
  • (a) A formula in CNF is a tautology exactly when every clause contains some atom together with its negation.
  • (b) A formula in DNF is satisfiable exactly when some conjunctive clause contains no atom together with its negation.

Try it first (ten minutes): take a clause in which no atom occurs both with and without ¬, such as p∨¬q∨r. Can you find a row that makes it false? What does that row do to a CNF containing this clause?

Idea. The direction “every clause has a pair ⇒ tautology” is the easy one: p∨¬p is true in every row, so a clause containing both is too, and a conjunction of clauses true in every row is true in every row. The attempt above is the other direction. To make a CNF false, it is enough to make one clause false, and a clause is false only when all its literals are. So set every atom of the clause against its literal: F for a plain atom, T for a negated one. The one thing that could stop us is an atom that appears both plain and negated, since it would have to be both F and T. That is exactly the pair the proposition talks about.

Proof. (a) Let K=K1∧⋯∧Kk be in CNF.

(⇐) Suppose every clause Ki contains some atom p and its negation ¬p. Let v be a valuation. One of p, ¬p is true under v, by Definition 4.4.2, so v(Ki)=T by Eq. 4.9.1. This holds for every i, so v(K)=T by Eq. 4.9.1. As v was arbitrary, K is a tautology (Definition 4.5.1).

(⇒) We prove the contrapositive. Suppose some clause Ki contains no atom together with its negation. Define a valuation v by: v(p):=F if the literal p occurs in Ki; v(p):=T if the literal ¬p occurs in Ki; v(p):=T for every other atom. This is well defined, because no atom occurs in Ki both as p and as ¬p. Every literal of Ki is false under v, so v(Ki)=F by Eq. 4.9.1, and hence v(K)=F, again by Eq. 4.9.1. So K is not a tautology.

(b) Let D=C1∨⋯∨Ck be in DNF.

(⇐) Suppose Ci contains no atom together with its negation. Define v by v(p):=T if p occurs in Ci, v(p):=F if ¬p occurs in Ci, and v(p):=T otherwise; this is well defined as in (a). Every literal of Ci is true under v, so v(Ci)=T and v(D)=T by Eq. 4.9.1. So D is satisfiable (Definition 4.5.2).

(⇒) If every conjunctive clause contains some p and ¬p, then under every valuation one of these two literals is false, so every conjunctive clause is false and so is D, by Eq. 4.9.1. So D is not satisfiable. This proves the proposition.

Second readingTwo faces of one fact

The two parts are two faces of one fact. Section 4.5 showed that a formula is a tautology exactly when its negation is unsatisfiable (after Definition 4.5.2). Let D be in DNF, and let K be the CNF whose clauses are the conjunctive clauses of D with every literal replaced by its opposite. The proof of Theorem 4.9.2, applied to φ=¬D with D itself as the DNF of ¬φ≡D, shows K≡¬D. A clause of K has an atom together with its negation exactly when the corresponding conjunctive clause of D has. So D is unsatisfiable exactly when ¬D, and so K, is a tautology, which by (a) happens exactly when every conjunctive clause of D has such a pair. That is (b) again.

The proposition trades one kind of work for another. Checking a CNF for validity is now a glance, but getting the CNF in the first place may take the 2n rows of the table route or the explosion of the rewriting route. Nothing is free: the work has moved, not vanished.

Example (Validity at a glance)

Decide whether each formula is a tautology, without a table.

  • (a) (¬p∨q∨p)∧(r∨¬q∨s∨q)∧(¬s∨¬r∨s)∧(p∨¬r∨r∨q).
  • (b) The same formula with the third clause changed to ¬s∨¬r∨q.

Solution. (a) Each clause has a pair: ¬p,p in the first; ¬q,q in the second; ¬s,s in the third; ¬r,r in the fourth. By Proposition 4.9.3 (a), it is a tautology. A table would have needed 16 rows.

(b) The new third clause ¬s∨¬r∨q has the atoms s, r, q, each once, so it has no pair, and the formula is not a tautology. The proof of Proposition 4.9.3 names a refuting row: s=T, r=T, q=F, and p=T, like every atom not in the clause; in fact either value of p works. In that row the third clause is F, so the conjunction is F.

4.9.6. Calculating with equivalences

Section 4.5 replaced a part of a formula by an equivalent part (Lemma 4.5.2) and chained such steps, since ≡ is transitive. Normal forms can be reached in this way, as the rewriting route did, and so can shorter formulas. Each step cites a law, as each line of a derivation cites a rule. A few more laws make the calculations run; in them, ¬⊥ serves as a formula that is true in every row.

Proposition 4.9.4 (Laws of the Constants, Idempotence and Absorption)

For all formulas φ and ψ:

  • (a) φ∧¬⊥≡φ and φ∨⊥≡φ;
  • (b) φ∧⊥≡⊥ and φ∨¬⊥≡¬⊥;
  • (c) φ∧¬φ≡⊥ and φ∨¬φ≡¬⊥;
  • (d) φ∧φ≡φ and φ∨φ≡φ;
  • (e) φ∧(φ∨ψ)≡φ and φ∨(φ∧ψ)≡φ.
Second readingThe tables for the further laws

Proof. As for Proposition 4.5.1: fix a valuation v, and let a=v(φ) and b=v(ψ). By (V1) and (V2) of Definition 4.4.2, v(⊥)=F and v(¬⊥)=T, so the value of each side under v is computed from a (and b) by the clauses of its connectives. The first table covers (a)–(d), with one row for each value of a; the second covers (e), with one row for each pair (a,b). aφ∧¬⊥φ∨⊥φ∧⊥φ∨¬⊥φ∧¬φφ∨¬φφ∧φφ∨φTTTFTFTTTFFFFTFTFFabφ∧(φ∨ψ)φ∨(φ∧ψ)TTTTTFTTFTFFFFFF In (a), (d) and (e) both columns agree with a; in (b) and (c) the columns are constant, F where the right side is ⊥ and T where it is ¬⊥. So both sides of each law have the same value under v, and as v was arbitrary they are equivalent, by the paraphrase of Definition 4.5.4.

Example (Simplifying by a chain)

Simplify (p→q)∧(p→¬q), citing a law at each step.

Solution. (p→q)∧(p→¬q)≡(¬p∨q)∧(¬p∨¬q)≡¬p∨(q∧¬q)≡¬p∨⊥≡¬p. Step 1 is (c) of Proposition 4.5.1, used twice, each time applied inside the formula by Lemma 4.5.2. Step 2 is (g), second form, read from right to left with φ=¬p, ψ=q, χ=¬q. Step 3 is (c) of Proposition 4.9.4, applied inside. Step 4 is (a).

Read the result: if p gives both q and not q, then not p. This is the table’s face of ¬I.

Quick check. Simplify (p∨q)∧(p∨¬q), citing a law at each step.

Solution. (p∨q)∧(p∨¬q)≡p∨(q∧¬q)≡p∨⊥≡p: (g) of Proposition 4.5.1, second form, read from right to left; then (c) of Proposition 4.9.4, first form, applied inside by Lemma 4.5.2; then its (a), second form.

4.9.7. Stronger and weaker parts

Replacing a part by an equivalent part keeps the value of the whole (Lemma 4.5.2). Replacing it by a stronger or a weaker part moves the value in one direction, and which direction depends on where the part sits.

Definition 4.9.4 (Positive and Negative Occurrences)

Each node of the parse tree of a formula χ (an occurrence of a subformula, Section 4.5) is positive, negative, or unsigned, by the path from the root: the root is positive; the part of a node ¬θ, and the left part of a node θ1→θ2, have the sign opposite to that node; the parts of a node θ1∧θ2 or θ1∨θ2, and the right part of θ1→θ2, have the same sign as that node; the parts of a node θ1↔θ2, and every node below them, are unsigned.

In words: walk down from the root; the sign flips at each negation and at each hypothesis of an implication, and stays at every other step. A biconditional uses each part in both directions, as hypothesis and as conclusion, so below it nothing is signed. The sign is well defined because a formula has only one parse tree (Section 4.3).

Diagram. Labels: to, p, q, r

The parse tree of (¬p→q)∧¬r, each node with its sign. Signs flip at each ¬ and on the left of each →: here p is positive (two flips), q positive, r negative.

Theorem 4.9.5 (Monotonicity)

Let α⊨β, and let χ′ be obtained from χ by replacing one occurrence of α by β. If the occurrence is positive, then χ⊨χ′; if it is negative, then χ′⊨χ.

In words: a stronger part in a positive place makes the whole stronger; in a negative place, weaker. Two readings are used daily. A stronger hypothesis gives a weaker theorem: the hypothesis of α→θ is negative, so from α⊨β we get (β→θ)⊨(α→θ). It suffices to prove something stronger: the conclusion is positive, so from α⊨β we get (θ→α)⊨(θ→β). For example, from p∧q⊨p the theorem gives (r→(p∧q))⊨(r→p) and (p→r)⊨((p∧q)→r).

Idea. Induct on χ, as for Lemma 4.5.2. There the replaced part kept its value, and so did the whole. Here truth passes one way only: from the old part to the new one, and up through ∧, ∨ and the right of → unchanged; at a ¬ and at the left of a → the direction turns round, exactly where the sign flips.

Second readingThe proof of monotonicity

Proof. We apply Theorem 4.3.1 to the property M(χ): for every positive or negative occurrence of α in χ, with χ′ the result of replacing it by β, and every valuation v: if the occurrence is positive, v(χ)=T implies v(χ′)=T; if it is negative, v(χ′)=T implies v(χ)=T. By Definition 4.5.3, these say χ⊨χ′ and χ′⊨χ.

Signs inside a part. Let θ be an immediate part of χ. The parse tree of θ is a subtree of that of χ (Definition 4.1.2), and the path from the root of χ to a node of θ is the path from the root of θ with one step on top. So the node’s sign in χ is its sign in θ if θ is positive in χ, the opposite sign if θ is negative, and none if θ is unsigned.

If the occurrence is the root, it is positive, χ=α and χ′=β, and v(α)=T implies v(β)=T because α⊨β. An atom or ⊥ has no other node. Otherwise the occurrence lies in one immediate part, and χ′ is χ with that part θ replaced by the result θ′ of the replacement inside it.

χ=¬θ. The part is negative, so the occurrence has opposite signs in χ and in θ. If it is positive in χ, it is negative in θ, and M(θ) gives: v(θ′)=T implies v(θ)=T. So if v(¬θ)=T, then v(θ)=F, hence v(θ′)=F, and v(¬θ′)=T by (V2). If it is negative in χ, the same argument runs with θ and θ′ exchanged.

χ=θ1∧θ2 or θ1∨θ2. Both parts are positive, so the signs in χ and in the part agree. Clauses (V3) and (V4) are monotone in each part: if a part is replaced by one that is true whenever it was, a true conjunction or disjunction stays true. With M of the part, this gives the claim in both cases.

χ=θ1→θ2. In θ2 the signs agree, and (V5) is monotone in the conclusion: if v(θ2)=T implies v(θ2′)=T, then v(θ1→θ2)=T implies v(θ1→θ2′)=T. In θ1 the signs are opposite, and (V5) is antitone in the hypothesis: if v(θ1′)=T implies v(θ1)=T, then v(θ1→θ2)=T implies v(θ1′→θ2)=T, since a false θ1 leaves θ1′ false. An occurrence positive in χ is negative in θ1, so M(θ1) supplies exactly this premise; a negative one is positive in θ1, and the argument runs with θ1 and θ1′ exchanged.

χ=θ1↔θ2. Every node below the root is unsigned, so there is no occurrence to treat.

By Theorem 4.3.1, M(χ) holds for every formula χ. This proves the theorem.

Quick check. Give the sign of each atom occurrence in ¬(p→q)∨r.

Solution. p is positive: flipped by the ¬, and again as the hypothesis of →. q is negative: flipped by the ¬ only. r is positive.

Warning. Below a ↔ nothing may be strengthened. p∧q⊨p, but (p∧q)↔r and p↔r entail each other in neither direction: the row p=T, q=r=F makes the first true and the second false, and the row p=r=T, q=F does the reverse.

4.9.8. Adequate sets of connectives

Our formulas use five connectives and ⊥. Chapter 2 already showed that some of them can be traded for others: an implication for a disjunction (Proposition 2.5.6), a biconditional for two implications (Proposition 2.4.1). How far can this go? Before we can answer, we need to say what a set of connectives must be able to “say”.

Every formula whose atoms are among p1,…,pn has a truth table: a value for each of the 2n rows. Turn this around, and ask whether every table is the table of some formula.

Section 4.4 called such a table a truth function (Definition 4.4.4): a value for each list of inputs, with no formula attached; a formula expresses it when it has that table.

There are 2n lists of inputs and two choices of output for each, so there are 22n truth functions with n inputs: 4 with one input and 16 with two. Examples: the negation function with one input, T↦F, F↦T, expressed by ¬p1; the two-input function that is T only at (T,T), expressed by p1∧p2; the three-input majority function, T when at least two inputs are T, expressed by (p1∧p2)∨(p1∧p3)∨(p2∧p3). A degenerate case: the one-input function that is always T is expressed by p1∨¬p1, and also by p2→p2, which does not mention p1 at all. The definition allows that.

We say a formula is in a set S of connectives if every connective occurring in it belongs to S, and ⊥ occurs in it only if ⊥ belongs to S (for this purpose ⊥ counts as a connective with no inputs).

Definition 4.9.5 (Adequate Set of Connectives)

A set S of connectives is adequate if every truth function, with any number n≥1 of inputs, is expressed by some formula in S.

A set containing an adequate set is adequate, since a formula in the smaller set is also in the larger one. The theorem below shows that {¬,∧,∨} is adequate, so the full set {¬,∧,∨,→,↔,⊥} is too. The question is which smaller sets are.

Rewriting “or” with “not” and “and”. The DNF of a truth table uses ¬, ∧ and ∨. To do without ∨, rewrite each disjunction by De Morgan’s law: α∨β has the same table as ¬(¬α∧¬β). Done everywhere, from the leaves up, this is a translation t1 of the formulas built from atoms with ¬, ∧, ∨ (the proof below gives the clauses for ⊥, →, ↔): t1(p)=p, t1(¬α)=¬t1(α), t1(α∧β)=t1(α)∧t1(β), t1(α∨β)=¬(¬t1(α)∧¬t1(β)). For instance t1((p∨q)∧¬r)=¬(¬p∧¬q)∧¬r. In the row p=F, q=T, r=F both sides are T: on the left p∨q and ¬r are T; on the right ¬p∧¬q is F, so its negation is T, and ¬r is T. Two more translations do the same for the other sets of the theorem below:

t1, into {¬,∧} t2, into {¬,∨} t3, into {→,⊥}
¬α ¬t1(α) ¬t2(α) t3(α)→⊥
α∧β t1(α)∧t1(β) ¬(¬t2(α)∨¬t2(β)) (t3(α)→(t3(β)→⊥))→⊥
α∨β ¬(¬t1(α)∧¬t1(β)) t2(α)∨t2(β) (t3(α)→⊥)→t3(β)

Quick check. Use the translation t3 to express p∧q with → and ⊥ only, and check your formula in the row p=T, q=F.

Solution. t3(p∧q)=(p→(q→⊥))→⊥. In the row p=T, q=F: q→⊥ is F→F, so T; then p→(q→⊥) is T; then the whole is T→⊥, so F, which agrees with p∧q.

Theorem 4.9.6 (Adequate Sets)
  • (a) The sets {¬,∧,∨}, {¬,∧}, {¬,∨} and {→,⊥} are adequate.
  • (b) The set {∧,∨,→} is not adequate: no formula in it expresses the negation function.

Idea. For (a), the construction of Theorem 4.9.1 works for any table, not only for the table of a formula, and its output uses only ¬, ∧, ∨. To shrink the set further, rewrite each missing connective in terms of the others, for instance α∨β as ¬(¬α∧¬β), recursively through the formula. For (b), look at the row where every atom is true: ∧, ∨ and → all give T on T inputs, so every formula in them is T there, while negation must give F.

Proof. (a) The set {¬,∧,∨}. Let f be a truth function with n≥1 inputs. For each of the 2n lists of inputs, fix a valuation taking those values at p1,…,pn, and let v1,…,vk be those fixed for the lists where f is T. If k≥1, let D:=Cv1∨⋯∨Cvk, with the minterms Cv formed from p1,…,pn; if k=0, let D:=p1∧¬p1. By Eq. 4.9.1 and Eq. 4.9.2, a valuation w makes D true exactly when (w(p1),…,w(pn)) is a list where f is T, that is, when f(w(p1),…,w(pn))=T. So D expresses f, and D is in {¬,∧,∨}.

The other three sets. By Theorem 4.3.4, the following clauses define three functions t1,t2,t3 on all formulas. Each has ti(p):=p for every atom p, and ti(⊥):=⊥, ti(α→β):=ti(α)→ti(β) and ti(α↔β):=ti(α)↔ti(β) (these last clauses are never used below). The other clauses rewrite the connectives ¬, ∧, ∨:

  • t1, into {¬,∧}: t1(¬α):=¬t1(α), t1(α∧β):=t1(α)∧t1(β), and t1(α∨β):=¬(¬t1(α)∧¬t1(β));
  • t2, into {¬,∨}: t2(¬α):=¬t2(α), t2(α∧β):=¬(¬t2(α)∨¬t2(β)), and t2(α∨β):=t2(α)∨t2(β);
  • t3, into {→,⊥}: t3(¬α):=t3(α)→⊥, t3(α∧β):=(t3(α)→(t3(β)→⊥))→⊥, and t3(α∨β):=(t3(α)→⊥)→t3(β).

Claim. Let S1={¬,∧}, S2={¬,∨}, S3={→,⊥}. For every formula φ in {¬,∧,∨} and each i, the formula ti(φ) is in Si, and v(ti(φ))=v(φ) for every valuation v.

Proof of Claim. By structural induction (Theorem 4.3.1) on φ, with the property “if φ is in {¬,∧,∨}, then for each i, ti(φ) is in Si and has the same value as φ under every valuation”. The immediate parts of a formula in {¬,∧,∨} are in {¬,∧,∨}, so the induction hypothesis applies to them. For ⊥, α→β and α↔β the property holds vacuously, since these formulas are not in {¬,∧,∨}. For an atom, ti(p)=p. In the other cases, write a=v(ti(α))=v(α) and b=v(ti(β))=v(β), by the induction hypothesis. Each clause for ti above uses only the connectives of Si, applied to formulas in Si, so ti(φ) is in Si. For the values, use Definition 4.4.2, and that χ→⊥ is true exactly when χ is false (⊥ is always F):

  • ¬ti(α) and t3(α)→⊥ are true exactly when a=F, as is ¬α.
  • ¬(¬t2(α)∨¬t2(β)) is true exactly when neither ¬t2(α) nor ¬t2(β) is, that is, when a=b=T. And (t3(α)→(t3(β)→⊥))→⊥ is true exactly when t3(α)→(t3(β)→⊥) is false, that is, when a=T and t3(β)→⊥ is false, that is, when a=b=T. Both agree with α∧β.
  • ¬(¬t1(α)∧¬t1(β)) is true exactly when a and b are not both F. And (t3(α)→⊥)→t3(β) is true exactly when t3(α)→⊥ is false or b=T, that is, when a=T or b=T. Both agree with α∨β.

The remaining clauses, for t1(α∧β) and t2(α∨β), keep the connective and have the right value by the induction hypothesis.

Now let f be any truth function, and D the formula in {¬,∧,∨} that expresses it. By the Claim, ti(D) is in Si and v(ti(D))=v(D)=f(v(p1),…,v(pn)) for every valuation v. So each Si is adequate.

(b) Let vT be the valuation with vT(p)=T for every atom p. We show by structural induction that every formula in {∧,∨,→} is true under vT; the property is “if φ is in {∧,∨,→}, then vT(φ)=T”. For an atom, vT(p)=T. The formulas ⊥, ¬α and α↔β are not in the set, so for them the property holds vacuously. If φ is α∧β, α∨β or α→β and is in the set, then so are α and β, and by the induction hypothesis vT(α)=vT(β)=T. By Definition 4.4.2, vT(α∧β)=T and vT(α∨β)=T; and vT(α→β)=T because its conclusion β is true. By Theorem 4.3.1, every formula in the set is true under vT.

Now suppose some φ in {∧,∨,→} expressed the negation function f. Then vT(φ)=f(vT(p1))=f(T)=F, contradicting vT(φ)=T. So no such φ exists, and the set is not adequate. This proves the theorem.

In the implication case of (b), the reason is that the conclusion β is true. That is where a careless argument goes wrong, and Exercise (C2: Find the error, used later) asked you to find a “proof” that goes wrong there.

The five connectives were chosen because each matches a word mathematicians use, not because they are needed: two suffice, and Exercise (C1: One connective is enough) shows that one well-chosen connective suffices.

Warning. The ⊥ in {→,⊥} is essential. Without it, {→} is not adequate: every formula in {→} is also in {∧,∨,→}, so by (b) of Theorem 4.9.6 none expresses negation. Implication alone cannot say “false”; implication together with a formula that is always false can.

4.9.9. Exercises

A. Check your understanding

Exercise (A1)
  • (a) Which of ¬p, ¬¬q, ⊥, r and ¬(p∨q) are literals?
  • (b) Classify each as a clause, a conjunctive clause, both, or neither: p∨¬q; ¬r; p∧(q∨r).
  • (c) Is (p∨q)∧(¬p∨p∨r) a tautology? Is (q∨¬q)∧(¬r∨p∨r)? Give a refuting row where the answer is no.
  • (d) Give a formula in DNF that is not satisfiable.
  • (e) True or false: every formula in CNF with only one clause is also in DNF.

Solution. (a) ¬p and r. ¬¬q has two negations, ⊥ is not an atom, and ¬(p∨q) negates a disjunction.

(b) p∨¬q is a clause. ¬r is both (one literal). p∧(q∨r) is neither: its part q∨r is not a literal.

(c) The first is not a tautology: its first clause p∨q has no pair, and the row p=q=F (any r) makes it false, hence the whole conjunction. The second is: each clause has a pair (q,¬q and r,¬r), by Proposition 4.9.3 (a).

(d) p∧¬p: its one conjunctive clause contains a pair, so by Proposition 4.9.3 (b) it is not satisfiable.

(e) True. A single clause ℓ1∨⋯∨ℓm is a disjunction of m conjunctive clauses of one literal each.

Exercise (A2: Drill)

The parts run from one step of a calculation, through signs and what monotonicity gives, to normal forms and an adequate set.

  • (a) Simplify p∧(p∨q).
  • (b) Simplify ¬(p→q).
  • (c) Simplify (p∨q)∧¬p.
  • (d) Simplify (p∧q)∨(p∧¬q).
  • (e) What is the sign of p in ¬(p→q)?
  • (f) What is the sign of q in (p→¬q)∧r?
  • (g) What is the sign of p in p↔q?
  • (h) From p∧q⊨p, what does Theorem 4.9.5 give for r→(p∧q)?
  • (i) Give a DNF of p↔q.
  • (j) Give a CNF of p↔q.
  • (k) How many minterms has the DNF of Theorem 4.9.1 for a tautology whose atoms are p, q, r?
  • (l) Is {¬,→} adequate?

Solution.

  • (a) p, by Proposition 4.9.4 (e).

  • (b) p∧¬q: (c), then (b), then (d) of Proposition 4.5.1 give ¬(¬p∨q), ¬¬p∧¬q, p∧¬q.

  • (c) ¬p∧q: distributivity and commutativity give (p∧¬p)∨(q∧¬p); then (c) of Proposition 4.9.4 gives ⊥∨(q∧¬p), and (a) with commutativity gives ¬p∧q.

  • (d) p: (g) read from right to left gives p∧(q∨¬q), then (c) and (a) of Proposition 4.9.4.

  • (e) Positive: the ¬ flips it, and so does the hypothesis place of →.

  • (f) Negative: the right side of → keeps the sign, the ¬ flips it.

  • (g) Unsigned: it is a part of a biconditional.

  • (h) (r→(p∧q))⊨(r→p): p∧q sits in the conclusion, a positive place.

  • (i) (p∧q)∨(¬p∧¬q), one minterm per T-row.

  • (j) (¬p∨q)∧(p∨¬q), one clause per F-row.

  • (k) 8: one for each of the eight rows, since all are T-rows.

  • (l) Yes: α∨β≡¬α→β, so a formula in {¬,∨}, adequate by Theorem 4.9.6, can be rewritten into {¬,→}, from the leaves up.

B. Practice

Exercise (B1: Normal forms of three formulas)

Find a DNF and a CNF of each formula, by either route, and check one of them in two rows.

  • (a) p↔¬q.
  • (b) (p∧q)→r.
  • (c) ¬(p∨(q→r)).

Solution. (a) By the table: p↔¬q is true when p and q have opposite values, so its T-rows are T, F and F, T, and its F-rows are T, T and F, F. DNF: (p∧¬q)∨(¬p∧q), as in Example (Exactly one of two). CNF, one clause per F-row from the opposite literals: the row T, T gives ¬p∨¬q and the row F, F gives p∨q, so (¬p∨¬q)∧(p∨q). Check the CNF: in the row T, F both clauses are true, and so is p↔¬q; in the row T, T the first clause is false, and so is p↔¬q.

(b) By rewriting: (p∧q)→r≡¬(p∧q)∨r≡¬p∨¬q∨r. This is a single clause, so it is a CNF, and it is also a DNF with three one-literal conjunctive clauses. Check: in the row T, T, F it is false (every literal false), as is (p∧q)→r; in the row F, T, F it is true, as is the original (its hypothesis is false).

(c) By rewriting: ¬(p∨(q→r))≡¬p∧¬(q→r)≡¬p∧¬(¬q∨r)≡¬p∧q∧¬r. This single conjunctive clause is a DNF, and it is also a CNF with three one-literal clauses. Check: in the row F, T, F it is true, and so is the original (q→r is false and p is false); in the row F, T, T it is false, and so is the original (q→r is true).

Exercise (B2: Two connectives from two)

Find formulas in {¬,∧}, with atoms p and q, equivalent to p∨q and to p↔q. Check the second by a truth table.

Solution. p∨q≡¬(¬p∧¬q): this is the translation t1 in the proof of Theorem 4.9.6, and the right side is F exactly when ¬p and ¬q are both true, that is, when p∨q is F.

For the biconditional, p↔q says p→q and q→p, and p→q says “not p without q”, that is, ¬(p∧¬q). So p↔q≡¬(p∧¬q)∧¬(¬p∧q). The table: pq¬(p∧¬q)¬(¬p∧q)¬(p∧¬q)∧¬(¬p∧q)p↔qTTTTTTTFFTFFFTTFFFFFTTTT The last two columns agree in every row.

Exercise (B3: Odd parity)

Give an example of a formula in DNF, with atoms p, q, r, that is true in exactly the rows where an odd number of p, q, r are true. List the properties your answer must have, and check it against them.

Solution. The rows with an odd number of T’s are those with three T’s, T T T, and those with one, T F F, F T F, and F F T. One minterm per row, as in Theorem 4.9.1: (p∧q∧r)∨(p∧¬q∧¬r)∨(¬p∧q∧¬r)∨(¬p∧¬q∧r). The properties an answer must have: (i) it is in DNF (a disjunction of conjunctions of literals); (ii) its atoms are among p, q, r; (iii) it is T in the four rows T T T, T F F, F T F, F F T; (iv) it is F in the other four, T T F, T F T, F T T, F F F. Check: (i) and (ii) hold by inspection. By Eq. 4.9.2, each minterm is T in its own row only, so the disjunction is T exactly in the four rows listed, which gives (iii) and (iv).

A different correct answer, for instance the same minterms in another order, or with the literals of a minterm reordered, passes the same checks. No DNF with fewer conjunctive clauses works. A conjunctive clause containing an atom and its negation is T in no row and contributes nothing. Any other conjunctive clause omitting an atom, say p∧q, is T in two rows that differ at that atom, and changing one atom always changes the parity, so one of those rows has even parity. So every conjunctive clause that is T somewhere mentions all three atoms and is T in exactly one row, and four T-rows need at least four conjunctive clauses.

C. Going deeper

Exercise (C1: One connective is enough)

Add to the language two binary connectives: α|β (“not both”, NAND), which is F exactly when α and β are both T, and α↓β (“neither”, NOR), which is T exactly when α and β are both F.

  • (a) Prove that {|} is adequate.
  • (b) Prove that {↓} is adequate.

Solution. (a) First, two equivalences, checked from the table of |: α|α is F exactly when α is T, so α|α≡¬α; and (α|β)|(α|β)≡¬(α|β), which is T exactly when α and β are both T, so it is equivalent to α∧β. Now define, by recursion on formulas as in Theorem 4.3.4, s(p):=p, s(¬α):=s(α)|s(α), s(α∧β):=(s(α)|s(β))|(s(α)|s(β)) (the other clauses do not matter). By structural induction, exactly as in the Claim in the proof of Theorem 4.9.6, every formula φ in {¬,∧} has s(φ) in {|} and v(s(φ))=v(φ) for every v: the atom case is immediate, and the two equivalences above give the ¬ and ∧ cases from the induction hypothesis. Given a truth function f, Theorem 4.9.6 (a) gives a formula φ in {¬,∧} expressing it, and then s(φ) expresses f and is in {|}.

(b) The same, with {¬,∨}: α↓α is T exactly when α is F, so α↓α≡¬α; and (α↓β)↓(α↓β)≡¬(α↓β)≡α∨β. The recursive translation s(¬α):=s(α)↓s(α), s(α∨β):=(s(α)↓s(β))↓(s(α)↓s(β)) turns a formula in {¬,∨} expressing f into one in {↓}.

(Recursion and structural induction for the language with the new connectives hold by the same proofs as Theorem 4.3.4 and Theorem 4.3.1, with one more formation clause.)

Marking scheme. (10 points)

  • 3: (a) two equivalences expressing the connectives of an adequate set from Theorem 4.9.6 (a) in terms of |, read off its table (for instance α|α≡¬α and (α|β)|(α|β)≡α∧β).
  • 3: (a) the recursive translation and the structural induction showing that it keeps the value under every valuation.
  • 1: (a) the conclusion, via Theorem 4.9.6 (a).
  • 3: (b) the same for ↓, with {¬,∨}.

Fatal errors (0 for the step): checking the translation on examples only, with no induction.

Exercise (C2: Two sets that are not adequate)
  • (a) Prove that {∧,∨,→,↔} is not adequate.
  • (b) Add to the language a three-place connective M(α,β,γ), majority, which is T exactly when at least two of α, β, γ are T. Prove that {¬,M} is not adequate.

Solution (Hint 1). For (b): compare each row with the row in which every atom’s value is flipped.

Solution (Hint 2). For (b): show that every formula in ¬ and M takes opposite values in a row and in its flipped row.

Solution. (a) Let vT make every atom true. Every formula in {∧,∨,→,↔} is true under vT, by the structural induction in the proof of Theorem 4.9.6 (b) with one more case: if vT(α)=vT(β)=T, then vT(α↔β)=T, since the two values are equal. As there, no such formula expresses negation, which must give F at the input T.

(b) For a valuation v, let v¯ be the flipped valuation: v¯(p) is the opposite of v(p), for every atom p. We show by structural induction that every formula φ in {¬,M} satisfies: for every valuation v, v¯(φ) is the opposite of v(φ). For an atom this is the definition of v¯. If v¯(α) is the opposite of v(α), then v¯(¬α), the opposite of v¯(α), is v(α), which is the opposite of v(¬α). If the property holds for α, β, γ, then flipping v flips all three values; at least two of them are T after the flip exactly when at least two were F before, that is, exactly when at most one was T, that is, exactly when M(α,β,γ) was F. So v¯(M(α,β,γ)) is the opposite of v(M(α,β,γ)). The other connectives and ⊥ do not occur in formulas of {¬,M}, so those cases are vacuous. (Structural induction for the extended language holds by the proof of Theorem 4.3.1, with one more formation clause.)

Now the two-input function of p1∧p2 is F at (T,F) and at the flipped input (F,T). If a formula φ in {¬,M} expressed it, then for a valuation v with v(p1)=T, v(p2)=F we would have v(φ)=F and v¯(φ)=F, since v¯(p1)=F and v¯(p2)=T. But these values must be opposite. So no formula in {¬,M} expresses it, and the set is not adequate.

Marking scheme. (10 points)

  • 3: (a) states the all-T valuation and runs the induction, with the ↔ case and the vacuous cases (¬, ⊥) named.
  • 1: (a) names a truth function that is not expressed (negation), with the reason.
  • 4: (b) states the flipped-row property for every formula in {¬,M} and proves it by structural induction, including the M case.
  • 2: (b) exhibits a truth function that takes the same value on some row and on its flipped row, and concludes.

Fatal errors (0 for the step): in (b), checking the flipped-row property on a few formulas instead of proving it for all; in (a), an implication case justified by the hypothesis being true rather than by the conclusion.

Exercise (C3: Exit check: normal forms)

Put (p→q)→(q∧r) into DNF and into CNF, by either route, and check one of your answers against the truth table.

Solution. By rewriting. Eliminate the outer implication and then the inner one, and push the negation in: (p→q)→(q∧r)≡¬(p→q)∨(q∧r)≡¬(¬p∨q)∨(q∧r)≡(p∧¬q)∨(q∧r). The last line is a DNF. Here ¬(p→q)≡p∧¬q, since an implication is false exactly when its hypothesis is true and its conclusion false. For a CNF, distribute: (p∧¬q)∨(q∧r)≡(p∨q)∧(p∨r)∧(¬q∨q)∧(¬q∨r), and drop the clause ¬q∨q, which is true in every row: the CNF is (p∨q)∧(p∨r)∧(¬q∨r). (The clause p∨r is redundant too: (p∨q)∧(¬q∨r) is an equivalent CNF, as splitting on q shows. Either is correct.)

The check. The formula is false exactly when p→q holds and q∧r fails. Its table: pqrp→qq∧r(p→q)→(q∧r)TTTTTTTTFTFFTFTFFTTFFFFTFTTTTTFTFTFFFFTTFFFFFTFF The T-rows are T T T, T F T, T F F, and F T T. The DNF (p∧¬q)∨(q∧r) is true in exactly these: p∧¬q in T F T and T F F, and q∧r in T T T and F T T. In each of the four F-rows the CNF has a false clause: ¬q∨r in T T F and F T F, p∨q in F F T and F F F.

By the table route, the DNF has four minterms, one per T-row, and the CNF four clauses, one per F-row, for instance ¬p∨¬q∨r for the row T T F. Any correct DNF and CNF earns full marks; a CNF is not unique.

Marking scheme. (10 points)

  • 2: the route carried out correctly: → eliminated, with ¬(p→q)≡p∧¬q and its reason, or the T-rows and F-rows read off a correct table.
  • 3: a correct DNF.
  • 3: a correct CNF, by distribution carried out in full or by one clause per F-row.
  • 2: the check against the table, covering at least the four F-rows (or the four T-rows).

Fatal errors (0 for the step): ¬(p→q) rewritten as ¬p→¬q; a “CNF” with a conjunction inside a clause.

Exercise (C4: From connectives to sets)

Let U be a collection, and A, B, E collections of members of U, in the everyday sense; U∖A is the collection of members of U not in A. For a member x of U, write a, b, e for the statements x∈A, x∈B, x∈E.

  • (a) Write “x∈U∖(A∩B)” and “x∈(U∖A)∪(U∖B)” as formulas in a, b, and deduce from a standard equivalence that the two collections have the same members.
  • (b) Show in the same way that A∩(B∪E) and (A∩B)∪(A∩E) have the same members.
  • (c) Show that (a→b)→((a∧e)→(b∧e)) is a tautology, and deduce: if every member of A is in B, then every member of A∩E is in B∩E.

Solution. (a) The formulas are ¬(a∧b) and ¬a∨¬b. They are equivalent by Proposition 4.5.1 (b). Each member x of U gives a valuation of a and b, by whether it lies in A and in B, and under that valuation the two formulas have the same value. So x is in one collection exactly when it is in the other.

(b) The formulas are a∧(b∨e) and (a∧b)∨(a∧e), equivalent by Proposition 4.5.1 (g); conclude as in (a).

(c) Work backwards from F. Falsity needs a→b true and (a∧e)→(b∧e) false, so a and e true and b∧e false. Then b is true, by a→b, so b∧e is true: no row makes the formula false, and it is a tautology. For each x, its memberships give a valuation making the formula true: so if “x∈A implies x∈B” holds, then “x∈A∩E implies x∈B∩E” holds. If every member of A is in B, the first holds for every x, hence so does the second.

Marking scheme. (8 points)

  • 3: (a), with the step from an equivalence to equal membership argued (each x gives a valuation).
  • 2: (b).
  • 3: (c): the tautology, and the step to collections.

Fatal errors (0 for the step): checking the set equality on one example collection only.

Exercise (C5: Counting rows)

For a formula φ whose atoms are among p1,…,pn, let #φ be the number of rows of the table on p1,…,pn in which φ is true.

  • (a) Show that φ⊨ψ implies #φ≤#ψ, and that the converse fails.
  • (b) Show that #(φ∨ψ)=#φ+#ψ−#(φ∧ψ).
  • (c) Show that the minterms of two different rows are never true together, and that the disjunction of all 2n minterms is a tautology. Deduce that, for satisfiable φ, the full DNF of φ over p1,…,pn (one minterm on p1,…,pn for each row on them in which φ is true) has exactly #φ minterms.

Solution. (a) If φ⊨ψ, every row in which φ is true is one in which ψ is true, so there are at least as many of the second. The converse fails: on the atoms p, q, the formulas p and q are each true in two rows, so #p≤#q, but p⊭q (the row p=T, q=F).

(b) By (V4), the rows of φ∨ψ are those of φ together with those of ψ. By (V3), the rows in both are the rows of φ∧ψ. The sum #φ+#ψ counts those twice and every other row of φ∨ψ once.

(c) Two different rows differ at some pi; one minterm contains pi and the other ¬pi, and no valuation makes both literals true. Each row makes its own minterm true (Eq. 4.9.2), so the disjunction of all 2n is true in every row (Eq. 4.9.1). The full DNF over p1,…,pn has one minterm for each row on them in which φ is true, and different rows give different minterms, so it has #φ of them. (It is not always the DNF that the proof of Theorem 4.9.1 builds. That proof uses only the atoms of φ, so when φ is satisfiable and has at least one atom, and j of the pi do not occur in φ, it gives #φ/2j minterms on the remaining atoms. When φ has no atoms it gives p∨¬p or p∧¬p. When #φ=0 it gives a contradiction q∧¬q for some atom q, which is a conjunctive clause but no minterm. Hence the restriction to satisfiable φ.)

Marking scheme. (8 points)

  • 2: (a) the inequality; 1: a counterexample to the converse, checked.
  • 2: (b), with the rows counted twice named.
  • 3: (c): different rows give minterms never true together; the disjunction of all is a tautology; the count.

Fatal errors (0 for the step): in (a), a “converse” argued from one pair of formulas that happen to entail each other.

Exercise (C6: Challenge: Interpolation)
  • (a) For φ=p∧q and ψ=q∨r, find a formula θ whose only atom is q, with φ⊨θ and θ⊨ψ.
  • (b) Prove: if φ⊨ψ, φ is satisfiable and ψ is not a tautology, then there is a formula θ, all of whose atoms occur both in φ and in ψ, with φ⊨θ and θ⊨ψ.
  • (c) Show that under the hypotheses of (b), φ and ψ have at least one atom in common.

Solution (Hint 1). Let θ say: the shared atoms take values that some row making φ true also gives them.

Solution (Hint 2). To show θ⊨ψ, build one row that agrees with a row of φ on the atoms of φ and with the given row on the other atoms of ψ.

Solution. (a) θ=q: p∧q⊨q and q⊨q∨r.

(c) (Proved first, since (b) uses it.) Suppose no atom is shared. Take a row u making φ true, and any row w. The row that agrees with u on the atoms of φ and with w on every other atom makes φ true (Lemma 4.4.1), hence ψ; it agrees with w on the atoms of ψ, none of which is an atom of φ, so w makes ψ true (Lemma 4.4.1 again). As w was any row, ψ would be a tautology.

(b) Let q1,…,qk be the shared atoms (k≥1 by (c)). Call a row s on q1,…,qk good if some valuation making φ true gives the qi the values of s; there is at least one, since φ is satisfiable. Let θ be the disjunction of the minterms, on q1,…,qk, of the good rows. Its atoms are shared.

φ⊨θ: a valuation making φ true gives the qi the values of a good row s, so it makes the minterm of s true (Eq. 4.9.2), hence θ.

θ⊨ψ: let w make θ true. Then w makes the minterm of some good row s true, so w gives the qi the values of s; and some u making φ true does the same. Let u′ agree with u on the atoms of φ and with w on every other atom. By Lemma 4.4.1, u′ makes φ true, so it makes ψ true, since φ⊨ψ. Now u′ agrees with w on every atom of ψ: on the shared atoms both give the values of s, and the other atoms of ψ are not atoms of φ. By Lemma 4.4.1, w makes ψ true.

Marking scheme. (12 points)

  • 1: (a).
  • 2: the definition of θ from the good rows, with its existence (satisfiable φ).
  • 2: φ⊨θ.
  • 5: θ⊨ψ, with the glued row and both uses of Lemma 4.4.1.
  • 2: (c).

Fatal errors (0 for the step): a θ with an atom of φ alone; a glued row that is not shown to agree with w on every atom of ψ.