csc438

Upload: peter-newton

Post on 04-Jun-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 CSC438

    1/17

    CSC 438F/2404F Notes Fall, 2012

    S. Cook and T. Pitassi

    REFERENCES

    The first two references have especially influenced these notes and are cited from time totime:

    [Buss] Samuel Buss: Chapter I: An introduction to proof theory, in Handbook of ProofTheory, Samuel Buss Ed., Elsevier, 1998, pp1-78.

    [B&M] John Bell and Moshe Machover: A Course in Mathematical Logic. North-Holland, 1977.

    Other logic texts: The first is more elementary and readable.

    [Enderton] Herbert Enderton: A Mathematical Introduction to Logic. Academic Press,1972.

    [Mendelson] E. Mendelson: Introduction to Mathematical Logic. Wadsworth & Brooks/Cole,1987.

    Computability text:

    [Sipser] Michael Sipser: Introduction to the Theory of Computation. PWS, 1997.

    [DSW] M. Davis, R. Sigal, and E. Weyuker: Computability, Complexity and Lan-

    guages: Fundamentals of Theoretical Computer Science. Academic Press, 1994.

    Propositional Calculus

    Throughout our treatment of formal logic it is important to distinguish betweensyntaxandsemantics. Syntax is concerned with the structure of strings of symbols (e.g. formulas andformal proofs), and rules for manipulating them, without regard to their meaning. Semanticsis concerned with their meaning.

    1

  • 8/13/2019 CSC438

    2/17

    Syntax

    Formulas are certain strings of symbols as specified below. In this chapter we use formulato meanpropositional formula. Later the meaning of formula will be extended to first-order

    formula.

    (Propositional) formulas are built from atoms P1, P2, P3, . . ., the unary connective , thebinary connectives , , and parentheses (,). (The symbols , and are read not,and and or, respectively.) We useP, Q,R, ... to stand for atoms. Formulas are definedrecursively as follows:

    Definition of Propositional Formula

    1) Any atom P is a formula.

    2) IfA is a formula so is A.

    3) IfA, B are formulas, so is (A B).

    4) IfA, B are formulas, so is (A B).

    All (propositional) formulas are constructed from atoms using rules 2) - 4).

    Examples of formulas: P , (P Q), ((P Q) (P Q)).

    A subformulaof a formula A is any substring ofA which is a formula. For example,P, Q,(P Q) and(P Q) are all subformulas of(P Q), but Pis not a subformula.

    We will use (implies) and(is equivalent to) as abbreviations as follows:

    (A B ) stands for (A B)

    (A B ) stands for ((A B ) (B A))

    Unique Readability Theorem: (The grammar for generating formulas is unambiguous)Suppose A, B , A, B are formulas, cand c are binary connectives, and (AcB) =syn (A

    cB).ThenA=syn A

    , B =syn B and c=syn c

    .

    Here we writeA

    =synA

    instead ofA

    =A

    to emphasize thatA

    andA

    are equal as stringsof symbols (syntactic identity, rather than semantic identity). Note that =syn is a symbol ofthe metalanguage rather than the formal object language.

    ProofAssign weights 0 to 1 to each binary connective, 1 to (

    1 to )1 to each atom P.

    2

  • 8/13/2019 CSC438

    3/17

    Definiton The WeightofA is the sum of the weights of the symbols in A.

    Lemma The weight of any formula is 1, but the weight of any proper initial segment is0. (Hence no proper initial segment of a formula is a formula. By a properinitial segmentwe mean an inital segment which is not the whole formula.)

    ProofStructural induction on length ofA. By structural inductionwe mean induction onthe length ofA, following the definition of propositional formula given above. The base caseof the induction is the case in which A is an atom P. The lemma is obvious in this case.The induction step has one case for each of the three ways of constructing new formulasfrom simpler formulas, using , , . For example, in the case of, the task is to prove thelemma for (A B), assuming (by the induction hypothesis) that the lemma holds for bothA and B. We leave this as an exercise.

    The Unique Readability Theorem follows from the Lemma, because if (AcB) =syn (AcB)

    then either A must be an initial segment ofA or vice versa, so in either case A= A by the

    Lemma.

    In practice we will omit some of the parentheses in a formula when it does not cause ambigu-ity. For example, we may writeP Qwhen we really mean (P Q). We use the conventionassociativity to the left for and . For example,

    (A1 A2 A3 A4) stands for (((A1 A2) A3) A4)

    Semantics

    Definition A truth assignmentis a map :{atoms} {T, F}.

    (Here {T, F} represents { true, false }). A truth assignment can be extended to assigneitherT or F to every formula, as follows:

    1) (A) =T iffA =F

    2) (A B) =T iffA =T and B =T

    3) (A B) =T iffA =T or B =T

    Definition satisfies A iff A = T; satisfiesa set of formulas iff satisfies A for allA . issatisfiableiff some satisfies ; otherwise is unsatisfiable. Similarly for A.

    IMPORTANT DEFINITION |=A (i.e. Ais a logical consequence of ) iff satisfiesA for every such that satisfies .

    Notation We sometimes use the notation |= A for |= A, and B |=A for {B} |= A, andB, C|=A for {B, C} |=A, etc.

    3

  • 8/13/2019 CSC438

    4/17

    Transitivity of Logical Consequence: If |=A and {A} |=B , then |=B .

    Proof: EXERCISE

    DefinitionA formulaA isvalidiff|=A (i.e.A =Tfor all). A valid propositional formulais called a tautology. We say that Aand B areequivalent(writtenAB ) iffA|=B and

    B |=A.

    Note thatrefers to semantic equivalence, as opposed to =syn, which indicates syntacticequivalence. For example, (P Q)(Q P), but (P Q)=syn (Q P).

    Convention: P, Q, Rstand fordistinctatoms, so for example (PQ)=syn (QP). HoweverA,B,C,... could stand for identical formulas.

    Proposition |=A iff {A} is unsatisfiable. AlsoAis a tautology iffAis unsatisfiable.

    Proof: Immediate from the definitions of unsatisfiable and |=.Examples: (Verify these)

    The following are tautologies for all formulas A, B , C :A AA A(A A)(A ((A B) (A B))

    Logical consequence:(A B)|= (A B)

    Equivalences:(A B)(B A) (is commutative)(A B)(B A) (is commutative)(A (B C))((A B) C) ( is associative)(A (B C))((A B) C) ( is associative)(A (B C))((A B) (A C)) (distributes over.)(A (B C))((A B) (A C)) (distributes over.)(A B)(A B) (De Morgans Law)(A B)(A B) (De Morgans Law)(A B )(B A) (contrapositive)

    Exercise 1 Prove the following Duality Theorem by structural induction on A: Let A

    be the result of interchanging and inA, and replacingP byPfor each atomP. ThenA A.

    Exercise 2 Give a semantic proof of the Craig Interpolation Lemma: Given propo-sitional formulas A and B, let S be the set of atoms which occur in both A and B, and

    4

  • 8/13/2019 CSC438

    5/17

    assume thatS is nonempty. IfA B is valid, then there is a formulaC(an interpolant)containing only atoms fromSsuch that bothA C andCB are valid.

    Remark: The Lemma still holds even whenSis empty, provided we include the symbols 0 and1 (meaning False and True) as building blocks in our definition of formula. It is illuminatingto consider this special case when trying to find the proof.

    DNF and CNF

    A formula of the form (A1 A2 ... An) is said to be a disjunction of the formulasA1, A2,...,An. Ifn = 1, then the disjunction is just the formulaA1. Ifn 3, then accordingto clause 4) in the definition ofpropositional formula(see page 2), extra parentheses mustbe inserted in order to make this a syntactically correct formula. Since is associative,the meaning of the formula does not depend on how these parentheses are inserted. Fordefiniteness, we will use the convention association to the left. Thus, for example

    (A1 A2 A3 A4) means (((A1 A2) A3) A4)

    Similarly, (A1A2 ... An) is said to be a conjunctionof the formulas A1, A2,...,An,and again we use the convention association to the left to specify the location of the extraparentheses.

    Definitions: A literal is an atom P, or a negated atom P. (We sometimes write P forP.)

    AclauseCis a disjunction of literals such that no variable occurs twice (negated or not) inthe disjunction.

    A formula is in conjunctive normal form(CNF) if it is a conjunction of one or more clauses.

    Note: We will consider the empty conjunction to be a CNF formula, even though it isnot a formula according to our definition on page 2. By way of semantics, is valid.

    Examples: The following formulas are in CNF:

    Q

    Q(P Q R)

    R (R S) (R S)

    The dual notion to CNF is DNF (disjunctive normal form). We say an -clause is a con-junction of literals with no repeated variable, and a formula is in DNF if it is a disjunctionof-clauses.

    We allow the empty disjunction to be a DNF formula, with the semantics that isunsatisfiable.

    5

  • 8/13/2019 CSC438

    6/17

    Examples of formulas in DNF can be obtained by interchanging and in the aboveexamples of CNF formulas.

    Theorem: Every formula is equivalent to a formula in CNF, and to a formula in DNF.

    Proof: One way to form a DNF equivalent to A is to put in an -clause corresponding to

    each truth assignment satisfying A. For example, if the truth assignment P =F, Q =T,R = F satisfies A, then include the -clause P Q R in the disjunction forming theDNF formula. IfA is unsatisfiable, then its DNF is the empty disjunction .

    CNF equivalent formulas are constructed in a dual fashion.

    Of course CNF and DNF equivalent formulas are far from unique. For example, (PQ)(PQ) is a CNF formula, and it is equivalent to the simpler CNF formula P. A traditional (butcomputationally intractable) problem is to find a smallest DNF (or CNF) formula equivalentto a given formula.

    Exercise 3 Prove that every CNF formula equivalent to

    (P1 Q1) (P2 Q2) ... (Pn Qn)

    must have at least2n clauses. (Hint: Show that for every assignment of either P or Q toeach of the subscripts{1, 2,...,n} there is a clause in the CNF which has exactly one ofPi,Qi for each i, according to whether P or Q is assigned to i. For example, if n = 3, thenthere must be a clause whose positive literals are exactly{Q1, P2, Q3}. (A literal ispositiveif is has no .)

    Formal Proofs

    One way to establish that a formula A with n atoms is a tautology is to verify that A =Tfor all 2n truth assignmentsto to the atoms ofA. A similar exhaustive method can be usedto verify thatA is a logical consequence of a finite set of formulas. However another way isto use the notion of a formal proof, which may be both more efficient and more illuminating.A formal proof is a syntactic notion, in contrast to validity, which is a semantic notion.Many formal proof systems have been studied. Here we present two examples: resolutionand Gentzens system P K. We give a brief introduction to the former, but we concentrateon the latter, since it will serve as the basis for our proof system for the predicate calculus.

    Resolution

    Resolution is important because it serves as the basis of most automated theorem provers,and is has been thoroughly studied and analyzed. Resolution in the propositional calculusis a proof system for establishing the unsatisfiability of CNF formulas. However it can begeneralized to apply to arbitrary propositional formulasA, establishing validity ifA is valid,or unsatisfiability ifA is unsatisfiable, or that |= A if that is the case. According to theProposition on page 4, all these things can be reduced to establishing the unsatisfiability of

    6

  • 8/13/2019 CSC438

    7/17

  • 8/13/2019 CSC438

    8/17

    C3 = (A B). We assume that A and B have no literal clashes, so that (A B) cannotcontain both a literal and its complement.

    Examples: The resolvant of P and P is the empty clause . The resolvant of (P Q)and (Q P) is P. The clauses (P Q) and (P Q) have no resolvant, because they havetwo clashes. The resolvant of (P Q R) and (Q S) is (P R S).

    Resolvant Soundness Principle: IfC3 is the resolvant ofC1 and C2, then

    C1, C2|=C3

    That is, the resolvant of two clauses is a logical consequence of the clauses. (See the IM-PORTANT DEFINITION, page 3.) This applies in particular ifC3 is the empty clause,which is unsatisfiable.

    RES Definition: A resolution refutationof a set Sof clauses is a sequence C1, C2,...,Cq ofclauses such that the final clause Cq is the empty clause , and eachCi is either in Sor is

    the resolvant of earlier clauses in the sequence.

    Example: Let S = {(P Q), (Q R), (P S), (P S), R}. Then a resolution refutation ofSis the sequence

    (P Q), (Q R), (P R), (P S), (P S), P , R , R,

    It is helpful to write this refutation in tree form, where the parents of a resolvant are thetwo clauses forming the resolvant.

    RES Soundness Theorem: If a set S of clauses has a resolution refutation, then S is

    unsatisfiable.

    Proof: Let C1, C2,...,Cq be a resolution refutation of S. Using the Resolvant SoundnessPrinciple above, and Transitivity of Logical Consequence (page 3), it follows by inductionon i that every clause Ci is a logical consequence ofS. In particular, the empty clause Cq isa logical consequence ofS. But is unsatisfiable. Hence no truth assignment can satisfyS.

    RES Completeness Theorem: Every unsatisfiable set of clauses has a resolution refuta-tion.

    Proof: We will prove this for finite sets Sof clauses, although by the Propositional Com-pactness Theorem (page 14) it follows also that every unsatisfiable infinite set Sof clauseshas a finite resolution refutation.

    To prove the theorem, we outline a procedure which can be used in practice to generate aresolution refutation ofS ifSis unsatisfiable, or to find a satisfying assignment for S ifS issatisfiable. The procedure maintains a set S Sof clauses which are arranged in a sequenceforming a partial resolution refutation ofS(i.e. a sequence of clauses each of which is eitherin Sor is a resolvant of earlier clauses in the sequence). The procedure also maintains a

    8

  • 8/13/2019 CSC438

    9/17

    stack 1, 2,...,k of literals representing a partial truth assignment to the atoms ofS. Thispartial assignment makes each literal j on the stack true, and it has the property that noclause in S is falsified by . (I.e. every clause in S has at least one literal not falsified by.)

    1. IfS includes the empty clause , then the resolution refutation consists simply of.

    Otherwise, initialize S =Sand initialize the stack of literals to be empty.

    2. The general step is as follows. If the partial assignment satisfies every clause in S,then output and halt. Otherwise select a clause C in Swhich is not satisfied by , and aliteral in Cwhich is not falsified by . Push onto the stack, and let be the resultingextension of (so makes true). If does not falsify any clause in S, then go to step 2with.

    3. Otherwise suppose that falsifies a clause C in S. Then replace on the stack by ,and let be the resulting partial truth assignment (so falsifies). If does not falsifyany clause in S, then go to step 2 with .

    4. Otherwise suppose that falsifies the clause C in S. In this case the clauses C andC can be resolved, forming a resolvant R which eliminates the literals and , and suchthat R is falsified by the original truth assignment from step 2 (and hence does not occurin S). If R is the empty clause, then output the resolution refutation S {R} and halt.Otherwise pop the stack until the first point at which R is not falsified. Go to step 2 withS S {R}.

    To complete the proof, we need only show that the procedure always halts, since all haltingsteps end either with a satisfying assignment (step 2) or a resolution refutation (step 4).To see that the procedure halts, simply note that each execution of the general step results

    either in adding a new distinct literal to the stack, or adding a new clause to the list S

    .There are only finitely many literals, so eventually a new clause must be added to S, andthere are only finitely many distinct clauses that can be formed from the literals, so if nosatisfying assignment is found, eventually the empty clause must be added to S.

    An important theorem in proof complexity states that there are arbitrarily large unsatisfiableclause setsSwhose minimum resolution refutation contains a number of clauses exponentialin the number of clauses in S. From this it can be shown that most programs used in practicefor satisfiability testing require exponential time, in the worst case.

    Gentzens Proof System PK

    We now present the system P Kbased on the very elegant sequent calculus, introduced byGerhard Gentzen in 1935 (see [Buss], section 1.2.1).

    In the propositional sequent calculus system P K, each line in a proof is a sequent of theform

    S=A1,...,AkB1,...,B (1)

    where is a new symbol (not to be confused with ), and A1,...,Ak and B1,...,B are

    9

  • 8/13/2019 CSC438

    10/17

    sequences of formulas called cedents. (Here k and cannot both be 0.) We call the cedentA1,...,Ak theantecedentand B1,...,B thesuccedent.

    Semantics of Sequents

    The semantics of sequents is given as follows. We say that a truth assignment satisfies

    the sequent S in (1) iff either falsifies some Ai or satisfies some Bi. Thus the sequent isequivalent to the formula

    AS= (A1 A2 ... Ak) (B1 B2 ... B) (2)

    except ifk= 0 then AS is simply

    (B1 B2 ... B)

    and if= 0 then AS is simply(A1 A2 ... Ak)

    (In other words, the conjunction of the As implies the disjunction of theB s.) In the cases in

    which the antecedent or succedent is empty, we see that the sequent A is equivalent to theformula A, and A is equivalent to A, and just(with both antecedent and succedentempty) is false (unsatisfiable). We say that a sequent is valid if it is true under all truthassignments (which is the same as saying that its corresponding formulaASis a tautology).Similarly we can define the notion of logical consequence for sequents, by referring to thecorresponding formulas.

    Examples: The following are valid sequents, for any formulas A, B:

    A AA, AA, AA AA, (A B ) B

    A formal proof (or just proof) in the propositional sequent calculus P K is a finite rootedtree in which the nodes are (labeled with) sequents. The sequent at the root (written at thebottom) is what is being proved, and is called the endsequent. The sequents at the leaves,written at the top, arelogical axioms, and must be of the form A A, whereA is a formula.Each sequent other than the logical axioms must follow from its parent sequent(s) by one ofthe following rules of inference. For each rule, the sequent on the bottom follows from thesequent on the top. Here and denote finite sequences (possibly empty) of formulas, andA

    andB

    denote formulas.weakening rules

    left

    A, right

    , A

    exchange rules

    left1, A , B , 2

    1, B , A , 2 right

    1, A , B , 21, B , A , 2

    10

  • 8/13/2019 CSC438

    11/17

    contraction rules

    left, A , A

    , A right

    , A , A

    , A

    introduction rules

    left , AA,

    right A, , A

    introduction rules

    left A,B,

    (A B), right

    , A , B

    , (A B)

    introduction rules

    left A, B,

    (A B), right

    , A , B

    , (A B)

    cut rule , A A,

    The formula A in the cut rule is called the cut formula.

    Note that there is oneleftintroduction rule and one rightintroduction rule for each of thethree logical connectives, , . Further, these rules seem to be the simplest possible, giventhat the fact that for each introduction rule the bottom sequent is valid iff all top sequents

    are valid.

    Definition: A P Kproof of a formula A is a P Kproof of A.

    Exercise 5 Write down each of the six introduction rules from memory.

    Sequent Soundness Principle: For each P Krule, the sequent on the bottom is a logicalconsequence of the sequent(s) on the top.

    Proof: EXERCISE

    Note that repeated use of the exchange rules allows us to execute an arbitrary reordering ofthe formulas in the antecedent or succedent of a sequent. In presenting a proof in the systemP K, we will usually omit mention of the steps requiring the exchange rules, but of coursethey are there.

    As an example, we give a P Kproof of one of DeMorgans laws:

    (P Q) P Q

    11

  • 8/13/2019 CSC438

    12/17

    To find this (or any) proof, it is a good idea to start with the conclusion at the bottom, andwork up by removing the connectives one at a time, outermost first, by using the introductionrules in reverse. This can be continued until some atom P occurs on both the left andright side of a sequent. Then this sequent can be derived from the axiom P P usingweakenings and exchanges. The cut and contraction rules are not necessary, and weakenings

    are only needed immediately below axioms. (The cut rule can be used to shorten proofs,and contraction will be needed later for the predicate calculus.)

    P P(weakening)

    P P, Q( right)

    P, P, Q

    Q Q(weakening)

    Q Q, P( right)

    Q, P, Q( right)

    P Q, P, Q( right)

    P Q, P Q( left)

    (P Q) P Q

    Exercise 6 GiveP Kproofs for each of the following valid sequents:

    P Q (P Q)(P Q) P QP Q (P Q)

    Exercise 7 Show that the contraction rules can be derived from the cut rule (with weakeningsand exchanges).

    Exercise 8 Suppose that we allowed as a primitive connective, rather than one introducedby definition. Give the appropriate left and right introduction rules for.

    Now we prove that P K is both sound and complete. That is, a propositional sequent isprovable in P K iff it is valid.

    PK Soundness Theorem: Every sequent provable in P K is valid.

    Proof: We show that the endsequent in every P K proof is valid, by induction on thenumber of sequents in the proof. For the base case, the proof is a single line; an axiom

    A A. This is obviously valid. For the induction step, one need only verify for each rule, ifall top sequents are valid, then the bottom sequent is valid. This follows from the SequentSoundness Principle above.

    Cut-free proofs A P K proof is cut-freeif it does not use the cut rule. The following is auseful property of cut-free proofs.

    Subformula Property: Every formula in every sequent in a cut-free P Kproof is a sub-formula of a formula in the endsequent.

    12

  • 8/13/2019 CSC438

    13/17

    This principle is proved by a simple induction on the length of cut-free P K proofs, byobserving that for every P Krule except cut, every formula on the top is a subformula ofsome formula on the bottom. In other words, once a formula occurs in a P Kproof, there isno way to get rid of it except by using the cut rule.

    In fact, the cut rule is not necessary for proving that a formula is valid. However the cut rule

    can shorten the proof of validity. Also, as we shall see, the cut rule is sometimes necessaryfor showing that a formula is a logical consequence of other formulas.

    It turns out that the contraction rule is not necessary either (although it is necessary in thesystemLK for the predicate calculus).

    PK Completeness Theorem: Every valid propositional sequent has a cut-free P Kproofwhich does not use the contraction rule.

    Proof: The idea is discussed in the example proof above of DeMorgans laws. We need touse the inversion principle.

    Inversion Principle: For each P Krule except weakening, if the bottom sequent is valid,then all top sequents are valid.

    This principle is easily verified by inspecting each of the ten rules in question.

    Now for the completeness theorem: We show that every valid sequent has a P Kproof, by induction on the total number of logical connectives , , occurring in .For the base case, every formula in and is an atom, and since the sequent is valid, someatom Pmust occur in both and . Hence can be derived from the axiom P Pby weakenings and exchanges.

    For the induction step, let A be any nonatomic formula (i.e. A is not an atom) in or. Then by the definition of propositional formula A must have one of the forms (B C),(B C), or B. Thus can be derived from introduction, introduction, or introduction, respectively, using either theleftcase or therightcase, depending on whetherAis in or , and also using exhcanges, but no weakenings. In each case, each top sequentof the rule will have at least one fewer connective than , and the sequent is valid bythe inversion principle. Hence each top sequent has aP Kproof, by the induction hypothesis.

    Remark: The soundness and completeness theorems relate the semanticnotion of validityto the syntacticnotion of proof.

    We generalize the (semantic) definition of logical consequence from formulas to sequents inthe obvious way: A sequent S is a logical consequenceof a set of sequents iff every truthassignmentthat satisfies also satisfies S.

    We generalize the (syntactic) definition ofP Kproof of a sequent Sto aP Kproof ofSfroma set sequents (also called a P K proof) by allowing sequents in to be leaves (ornonlogical axioms) in the proof tree, in addition to the logical axioms A A. The P K

    13

  • 8/13/2019 CSC438

    14/17

  • 8/13/2019 CSC438

    15/17

    are the formulas A1, . . . , Ak, B1, . . . , B.)

    We say that a P K proof is anchoredif every cut formula in is a formula that occursin one of the sequents in .

    Anchored Completeness Theorem: If a sequent Sis a logical consequence of a set of

    sequents, then Shas an anchored P K proof.

    We illustrate the anchored completeness theorem by proving the special case in which consists of the single sequent A B. Assume that the sequent is a logical conse-quence ofA B . Then both of the sequents , A and B, A, are valid (why?).Hence by the earlier completeness theorem, they have P K proofs 1 and 2. We can usethese proofs to get a proof of from A B as shown below, where the double lineindicates several rules have been applied.

    1, A

    A B========== (weakenings, exchanges)

    A, , B

    2

    B,A, (cut)A,

    (cut)

    Next consider the case in which has the form { A1, A2, ..., Ak} for some set{A1,...,Ak} of formulas. Assume that is a logical consequence of in this case.Then the sequent

    A1, A2,...,Ak,

    is valid (why?), and hence has a P Kproof. Now we can use the assumptions and thecut rule to successively remove A1, A2,...,Ak from the above sequent to conclude .For example, A1 is removed as follows:

    A1================= (weakenings, exchanges)A2,...,Ak, , A1

    A1, A2,...,Ak, (cut)

    A2,...,Ak,

    Exercise 10 Prove the anchored completeness theorem for the more general case in which is any finite set of sequents.

    Propositional Compactness Theorem: We state three different forms of this result. Allthree are equivalent.

    Form 1: If is an unsatisfiable set of propositional formulas, then some finite subset of is unsatisfiable.

    Form 2: If a formula A is a logical consequence of a set of formulas, then A is a logicalconsequence of some finite subset of .

    15

  • 8/13/2019 CSC438

    16/17

    Form 3: If every finite subset of a set of formulas is satisfiable, then is satisfiable.

    Exercise 11 Prove the equivalence of the three forms. (Note that Form 3 is the contrapos-itive of Form 1.)

    Proof of Form 1: Let be an unsatisfiable set of formulas. We assume that the set of atomsoccurring in formulas in is finite or countable. In other words, there is an infinite listP1, P2, P3,... of distinct atoms which includes all atoms occurring in . The exercise belowconcerns the general case. Organize the set of truth valuations into an infinite rooted binarytree B. Each node except the root is labelled with a literal Pi or Pi. The two children ofthe root are labelled P1 and P1, indicating that P1 is assigned T or F, respectively. Thetwo children of each of these nodes are labelledP2and P2, respectively, indicating the truthvalue ofP2. Thus each infinite branch in the tree represents a complete truth assignment,and each path from the root to a node represents a truth assignment to the atoms P1,...,Pi,for some i.

    Now for every node in the tree B, prune the tree at (i.e. remove the subtree rooted at, keeping itself) if the partial truth assignment represented by the path to falsifiessome formula A in , where all atoms in Aget values from . Let B

    be the resultingpruned tree. Since is unsatisfiable, every path from the root in B must end after finitelymany steps in some leaflabelled with a formula Ain . It follows from Konigs Lemmabelow thatB is finite. Let be the finite subset of consisting of all formulas A labellingthe leaves of B. Since every truth assignment determines a path in B which ends in aleafA falsified by , it follows that

    is unsatisfiable.

    Konigs Lemma: Suppose T is a rooted tree in which every node has only finitely many

    children. If every branch in T is finite, then T is finite.

    Proof: We prove the contrapositive: IfTis infinite (but every node has only finitely manychildren) thenT has an infinite branch. We can define an infinite path in Tas follows: Startat the root. Since T is infinite but the root has only finitely many children, the subtreerooted at one of these children must be infinite. Choose such a child as the second node inthe branch, and continue.

    Exercise 12 (For those with some knowledge of set theory or point set topology) The aboveproof of the propositional compactness theorem only works when the set of atoms is countable,

    but the result still holds even when is an uncountable set with an uncountable set A ofatoms. Complete each of the two proof outlines below.

    (a) Prove Form 3 using Zorns Lemma as follows: Call a set of formulas finitely satisfiableif every finite subset of is satisfiable. Assume that is finitely satisfiable. LetCbe theclass of all finitely satisfiable sets of propositional formulas using atoms in . Orderthese sets by inclusion. Show that the union of any chain of sets in C is again in the

    16

  • 8/13/2019 CSC438

    17/17

    classC. Hence by Zorns Lemma, Chas a maximal element 0. Show that 0 has a uniquesatisfying assignment, and hence is satisfiable.

    (b) Show that Form 1 follows from Tychonoffs Theorem: The product of compact topologicalspaces is compact. The set of all truth assignments to the atom set A can be given theproduct topology, when viewed as the product for all atoms P in A of the two-point space

    {T, F}of assignments toP, with the discrete topology. By Tychonoffs Theorem, this spaceof assignments is compact. Show that for each formulaA, the set of assignments falsifyingAis open. Thus Form 1 follows from the definition of compact: every open cover has a finitesubcover.

    Exercise 13 A tile is a quadruple T = a,b,c,d, where a,b,c,d represent the colours as-signed to the top, bottom, left, and right, of T, respectively. If R is a region of the planeconsisting of a set of unit squares whose corners are integer lattice points, then atiling ofRusing a setS of tiles is an assignment of a tile from S to each unit square inR, such thatcolours agree on adjacent tiles. Formally, we represent a unit square by the co-ordinates of

    its lower left corner. Thus a tiling is a map f from certain pairs(i, j) to tiles inS such thatif f(i, j) = a,b ,c,d and f(i+ 1, j) = a, b, c, d, then d = c, and if f(i, j) = a,b,c,dandf(i, j+ 1) =a, b, c, d thena= b.

    (a) Suppose Rn is the n n square whose lower left corner is at the origin. Suppose thatS={T1,...,T}is a set of tiles, withTk=ak, bk, ck, dk, 1 k . Show how to construct apropositional formulaAn which is satisfiable iff there is a correct tiling ofRn usingS. Your

    formula should have an atomPkij for each tileTk and each square(i, j) in the region, whichasserts (intuitively) that square(i, j) is assigned tileTk. Every correct tiling ofRn using Sshould correspond to a truth assignment satisfyingAn.

    (b) Use part (a) and the propositional compactness theorem to conclude that if the finite setS of tiles can be used to tile each n n square Rn, then Scan be used to tile the entireupper-right quadrant of the plane.

    Exercise 14 Let G = (V, E) be an undirected graph with vertex set V and edge set E. A3-coloringofG is a map : V {R , B , Y }such that if{x, y} E then(x)=(y). (HereR , B , Y represent the colors red, blue, yellow.)

    (a) Supposen >1 and letVn= {0, 1,...,n 1} and letGn= (Vn, En) be an undirected graphwith vertex setVn. For eachi, 0 i < n letRi, Bi, Yi be propositional variables. (IntuitivelyRi assert that nodei is colored red, andBi, Yi assert it is colored blue, yellow, respectively.

    Give a propositional formulaAn using the variables{Ri, Bi, Yi |0 i < n} such thatAn issatisfiable iffGn has a 3-coloring. Do this in such a way thatAn can be computed efficiently

    fromGn (e.g. dont defineAn to beR1 ifGn has a 3-coloring and(R1 R1) otherwise).

    (b) LetV = N ={0, 1, 2,...} and letG= (V, E)be an undirected graph on the infinite vertexsetV. Forn >1 letGn be the induced subgraph ofGon the vertex setVn= {0, 1,...,n 1}.Prove that ifGn has a 3-coloring for alln >1 thenG has a 3-coloring.

    17