aaby, proof methods in logic [16 pgs]

Upload: gzalzalkovia

Post on 03-Apr-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 Aaby, Proof Methods in Logic [16 pgs]

    1/16

    Proof Methods in Logic

    Anthony A. Aaby

    Walla Walla College

    204 S. College Ave.

    College Place, WA 99324

    E-mail: [email protected]

    August 18, 2004

    Abstract

    There are several methods for presenting proofs. This work surveysfour, Hilbert style proofs, natural deduction, analytic tableaux, and se-

    quent systems.

    1 Preliminaries

    Let be a set of symbols and * be the set of all strings of finite lengthcomposed of symbols in including the empty string. A language L is a subsetof *. Alternately, let G = , P , S be a grammar where is a set of symbols,P a set of grammar rules, and S the symbol for sentences in the language. Thenotation L(G) designates the language defined by the grammar G. The set ofstrings in L/L(G) are called sentences or formulas.

    Three sets of formulas are distinguished, axioms (A), theorems (T), andformulas(F). In monotonic logic systems the relationship among them is:

    A T F= L *

    If the set of theorems is the same as the set of formulas (T = F), then thesystem is of little interest and in logic is said to be contradictory. Inferencerules I are functions from sets of formulas to formulas (I : (L) L for eachI I). The set of theorems are constructed from the set of axioms by theapplication of rules of inference. A proof is a sequence of statements, each ofwhich is an axiom, a previously proved theorem, or is derived from previous

    Copyright c 1999-2004 by Anthony A. Aaby. This work is licensed underthe Creative Commons Attribution License. To view a copy of this license, visit

    http://creativecommons.org/licenses/by/2.0/ or send a letter to Creative Commons, 559Nathan Abbott Way, Stanford, California 94305, USA.

    1

  • 7/28/2019 Aaby, Proof Methods in Logic [16 pgs]

    2/16

    statements in the sequence by means of a rule of inference. The notation U Tis used to indicate that there is a proof of T from the set of formulas U. Thetask of determining whether or not some arbitrary formula A is a member ofthe set of theorems is called theorem proving.

    There are several styles of proofs. The semi-formal style of proof common inmathematics papers and texts is a paragraph style. Formal proofs are presented

    in several formats. The following are the most common.

    Hilbert style proofs

    Natural Deduction

    Analytic Tableaux

    Sequent Systems

    Axiom systems have many logical axioms and few inference rules. Naturaldeduction systems have no logical axioms, only inference rules. Sequent andTableaux systems have one logical axiom and many inference rules. I beginwith the axiomatic approach since it is the most familiar.

    Direct proofs. In a direct proof, the last statement in the sequence is thegoal of the proof. A direct proof of a statement A begins with what isknown, various assumptions, axioms, and previously proved theorems. Ateach step, the consequences of what is already known are explored. Theproof terminates when the statement A is derived through the applicationof a rule of inference. For a formula of the form A B, proof begins withthe assumptions encapsulated in A, and proceeds to construct a sequencesof statements each of which is an axiom, a previously proved theorem, orfollows from previous statements by a rule of inference. The last statementin the sequence is B. However, it is easy to become diverted from the pathto the goal B. Direct proofs are also called bottom-up proofs.

    Indirect proofs: In an indirect proof, the first statement is the negation ofthe statement to be proved. An indirect proof of the statement A beginswith the assumption that the statement is false, i.e., assume that A istrue. The goal is to show that this assumption leads to a contradiction.At each step, the question is asked, What do I need to know in order forthe goal to be true?. The answer supplies intermediate goals. The proofterminates when all goals end in a contradiction. Indirect proof is alsoknown as proof by contradiction, top-down proof, goal directed proof, andbackward-chaining.

    Prove an equivalent expression: To prove A given that A B, prove Binstead. A commonly used equivalence is to prove the contrapositive i.e.,to prove A B, prove B A instead.

    Proof by counterexample: Given an assertion of the form : xP(x), dis-

    prove it by showing that there is a c such that P(c). This is equivalentto a direct proof of xP(x).

    2

  • 7/28/2019 Aaby, Proof Methods in Logic [16 pgs]

    3/16

    Mathematical induction. Mathematical induction is an axiom schema ofthe form: if P(0) [P(n) P(n + 1)] then nP(n). To use it, show thatP(0) holds and then assume P(n) and show P(n + 1).

    In second order logic, it is a single axiom and it has the form: P{ ifP(0) [P(n) P(n + 1)] then nP(n)} In a proof using induction, theestablishment of P(0) is called the base step. The assumption of P(n)is called the inductive hypothesis, and the proof of P(n+1) is called theinduction step.

    Strong induction combines the base step and the inductive hypothesis inthe assumption that P(i) holds for all i < k and then the inductive steprequires proof that P(k) holds.

    Recursive mathematical definitions. Recursive definition are of the form:

    1. List the basic elements of the set.

    2. Provide rules for defining additional elements of the set. The rulesutilize the basic elements and the rules.

    3. There are no elements other than those constructed under rules 1

    and 2. Well orderings. Every nonempty set of a linear order contains a smallest

    member.

    The formulas of logic are defined in Figure 1. Terminology: implication,converse, inverse, contrapositive, negation, and contradiction

    Proof or Theorem: A B proof of B from A.

    Implication: A B A B

    Converse: B A

    Inverse: A B B A

    Contrapositive: B A A B

    Negation: A A; (A B) A B; (A B) A B;(A B) A B; (A B) (A B) (A B); xA xA; xA xA.

    Contradiction: A A

    2 The Axiomatic Method

    Axiom systems have few inference rules and often many axioms and reasonforward(or bottom up) from axioms to theorems by applications of the inferencerules. The disadvantage with forward reasoning is that it gives no insight onhow to prove an arbitrary formula, thus requiring (considerable) experience.Proofs, however, are often shorter than those in other reasoning systems.

    SubstitutionModus Ponens

    3

  • 7/28/2019 Aaby, Proof Methods in Logic [16 pgs]

    4/16

    The set of atomic formulas, P, is defined by

    P = {Pij tk...tk+i1 | tl C, i, j , k, l N} with f P where

    C = {Fij tk...tk+i1 | tk C, i ,j,k N} is a set of terms,

    {P0j | j N} is a set of propositional constants, and

    {F0j | j N} is a set of individual constants.

    The set of formulas, F, is defined by

    F ::= P | FF | 2F | x.[F]xt

    where V = {xi | i N} is a set of individual variables, t C, x V,and textual substitution, [F]tx, is a part of the meta language anddesignates the formula that results from replacing each occurrence oft with x.

    Additional operators and infix notation:

    (A B) ABA (A f)(A B) (A B)(A B) (A B)f (A A)(A B) ((A B) (B A))

    3A 2Ax.A x.A

    Figure 1: Formulas of Logic

    4

  • 7/28/2019 Aaby, Proof Methods in Logic [16 pgs]

    5/16

    2.1 Classical logic

    Axioms

    1. A BA

    2. ABCABAC

    3. A A

    4. x.A[A]xc where x

    5. x. AB Ax.B where x is not free in A.

    Inference Rules

    1. (modus ponens) from A and AB infer B

    2. (generalization) from A, if x is a variable, infer x.A.

    Exercises

    1. Rewrite the axioms in infix form.

    2.2 Hilberts Axiomatization

    Axioms

    1. A BA

    2. A BC AB AC

    3. ABA

    4. ABB

    5. A B AB

    6. A AB

    7. B AB

    8. AC BC ABC

    9. AB AB

    10. AB BA

    11. AB BA AB

    12. AB BA

    13. x.A[A]xc where x

    5

  • 7/28/2019 Aaby, Proof Methods in Logic [16 pgs]

    6/16

    14. x. AB Ax.B where x is not free in A.

    Inference Rules

    1. (modus ponens) from A and AB infer B

    2. (generalization) from A, if x is a variable, infer x.A.

    Exercises

    1. Rewrite the axioms in infix form.

    Exercises

    1. Rewrite the axioms in infix form.

    3 Hilbert Style Proofs

    The Hilbert style of proofs is often used in teaching geometry in high school. AHilbert style system consists of a set of axioms and rules of inference. Proofsconsist of the theorem to be proved followed by a sequence of lines each of whichcontains a theorem, assumption, or an axiom and a reason why it is a theoremwith the last line the theorem being proved. Subproofs may be indented.

    Hilbert Style ProofTheorem to be proved: A BSteps Reasons

    1.

    (a)

    (b)

    2.

    1.

    (a)

    (b)

    2.

    Each step consists of a formula. The corresponding reason is either assump-tion, instance of a theorem, or an inference rule. The inference rules are thoseof natural deduction. The point of a proof is to provide convincing evidence ofthe correctness of some statement. The following proof formats make clear theintent of the proof as it is read from beginning to end.

    6

  • 7/28/2019 Aaby, Proof Methods in Logic [16 pgs]

    7/16

    NaturalDeduction Rule

    Hilbert Style Proof Format

    P, P Q

    Q

    Q1 P2 P Q

    By Modus Ponensexplanationexplanation

    A BA B

    A B1 B2 A3 A

    By ContrapositiveAssumption

    explanationBut A holds because explanation

    P, Q R

    P Q R

    P Q R1 P2 Q3 R

    By DeductionAssumptionAssumptionexplanation

    P Q Q

    P

    P1 P2 Q Q

    By ContradictionAssumptionexplanation

    P Q Q

    P

    P1 P2 Q Q

    By ContradictionAssumptionexplanation

    P Q, P R, Q RR

    R

    1 P Q2 P R3 Q R

    By Case Analysis

    explanationexplanationexplanation

    P Q, Q P

    P R

    P Q1 P Q2 Q P

    By Mutual implicationexplanationexplanation

    P(0), P(n) P(n + 1)

    n.P

    n.P1 P(0)2 P(n)3 P(n + 1)

    By Inductionexplanation(Base step)Assumption (Induction hypothesis)explanation(Induction step)

    4 Natural Deduction

    Natural deduction was invented independently by S. Jaskowski in 1934 andG. Gentzen in 1935. It is an approach to proof using rules that are designed tomirror human patterns of reasoning. There are no logical axioms, only inferencerules. For each logical connective, there are two kinds of inference rules, anintroduction rule and an elimination rule.

    Each introduction rule answers the question, under what conditions canthe connective be introduced.

    Each elimination ruleanswers the question, underheat conditions can theconnective be eliminated.

    The natural deduction rules of inference are listed in Figure 2.

    The nature of many proofs in natural deduction consists of picking aparta logical expression using the elimination rules to get at the constituent parts

    7

  • 7/28/2019 Aaby, Proof Methods in Logic [16 pgs]

    8/16

    IntroductionRules Elimination Rules

    A B B

    A

    A B B

    A

    A, B

    A B

    A B

    A, B

    A

    A B

    A B

    A

    A B

    A B

    A, A B

    B

    x.

    P(x)

    x.P(x)

    x.P(x)

    [P(x)]cxfor any c C

    x.

    P(c)

    x.[P(x)]xc

    x.P(x)

    [P(x)]cxfor new c C

    Figure 2: Natural Deduction Inference Rules

    8

  • 7/28/2019 Aaby, Proof Methods in Logic [16 pgs]

    9/16

    and then building up new expressions from the constituent parts using theintroduction rules. Natural deduction inference rules may be used in Hilbertstyle proofs and in sequent systems.

    5 The Analytic Properties

    Analytic properties of formulas refer to the logical meaning of formula. Themethod takes formulas apart and searches for contradictions among the result-ing sub-formulas. Thus analytic methods are associated with refutation styletheorem proving. The compound formulas (with the exception of the negation ofan atomic formula) are classified as of type with sub-formulas 1 and 2,type with sub-formulas 1 and 2, and type , or of type . The classificationscheme for formulas of classical first-order logic is summarized in Figure 3. Theclassification can also be applied to modal logics. Analytic methods are uti-lized the tableaux method and in sequent systems. Figure 3 lists the analyticalproperties of the classical logical connectives.

    The classification of the modal operators depends on the underlying model.

    Definition 5.1 By a Hintikka (downward saturated) set we mean a set

    S such that the following conditions hold for every formula of type alpha, beta,gamma, and delta in S.

    1. No atomic formula and its negation are both in S.

    2. If alpha is in S, then both alpha1 and alpha2 are in S.

    3. If beta is in S, then eitherbeta1 is in S or 2 is in S.

    4. If is in S, then for every c, (c) is in S.

    5. If is in S, then for some d, (d) is in S.

    Downward saturated sets are guaranteed to be coherent and consistent. Theconstruction of downward saturated sets is a purely syntactic procedure whichproduces a semantic truth assignment (truth function) for the set.

    Lemma 5.1 Hintikkas lemma for first-order logic Every Hintikka set Sis satisfiable.Proof: A valuation function is easily constructed from the Hintikka set. Thevaluation function maps all atomic formula S to t and those not appearing inthe set to f. The construction rules follow the rules for satisfiability. QED.

    6 The Method of Analytic Tableaux

    The method of analytic tableaux builds a proof tree using the analytic proper-ties (Section 5) of formulas which involves replacing a compound formula withone or more sub-formulas. The the proof terminates when a contradiction is

    found. Thus, like resolution, the method is based on refutation but is interest-ing because it builds a model of the formula under proof.

    9

  • 7/28/2019 Aaby, Proof Methods in Logic [16 pgs]

    10/16

    And alpha alpha1 alpha2A B A B2(A B) 2A 2Bx.(A B) x.A x.B

    Or beta beta1 beta2A B A B3(A B) 3A 3Bx.(A B) x.A x.B

    Universal gamma gamma(c)x.A [A]cx Any c C

    Existential delta delta(d)x.A [A]dx d is new

    Equivalences:

    NegationA A(A B) (A B)(A B) (A B)2A 3A3A 3Ax.A x.Ax.A x.ADistributive PropertiesA (B C) (A B) (A C)x.(A B) (x.A x.B)x.(A B) (x.A x.B)Commutative Properties(A B) (B A)(A B) (B A)x.y.A y.xAOther(A B) (A B)(A B) (A B) (A B)

    Figure 3: Analytic Subformula Classification

    10

  • 7/28/2019 Aaby, Proof Methods in Logic [16 pgs]

    11/16

    Linear Extension: Current Block|

    Child Block

    Branching Extension: Current Block/ \

    Left Branch Right Branch

    Branch Termination: Lit or Current Block contains p, p

    Figure 4: Block Tableau Construction

    Tableau Construction

    The tableau methodis a backward-chaining proof search method. The tableau isa tree with sets of formulas (a block) at each node and leaf. The constructionbegins with a set of formulas placed at the root of the tree (the negation of thetheorem to be proved is included in the set of formulas). The tree is extended by

    adding a new block as required by one of four reduction rules. The constructionof a branch is terminated when a contradictory block is constructed or whenno reduction rule applies. The construction of the tree is terminated when allbranches are terminated.

    We use the following conventions:

    p, q denote atomic formulas

    P, Q, and R denote formulas

    X, Y, and Z denote sets of formulas

    X, Y stands for X Y and X, P stands for X {P}

    Lit stands for a set of literal formulas - atomic formulas and negations of

    atomic formulas.

    In addition, we assume (though it is not necessary) that formulas are in negationnormal form.The form of the tableau rules for extending a branch, creating anew branch, and terminating a branch are given in Figure 4.

    Each reduction rule corresponds to one of the analytic properties (Section 5).Given a block of formulas containing a formula of type , , , , the reductionrules specify the replacement of a block with one or more blocks in which theformula is replaced with its sub-formulas. For example, Rule A permits thereplacement of a conjunction with the conjuncts and Rule B requires the blockto be replaced with two blocks each containing one of the disjuncts.

    By a block tableaufor a finite set, Fs, of formulas, we mean a tree constructedby placing the set Fs at the root, and then continuing according to the block

    tableau inference rules in Figure 5.Definition:

    11

  • 7/28/2019 Aaby, Proof Methods in Logic [16 pgs]

    12/16

    Rule A: S,

    |

    S, 1, 2

    Rule B: S,

    / \S, 1 S, 2

    Rule C: S,

    |

    S, (c), for any c C

    Rule D: S,

    |

    S, (c) where c C is new to the tree

    Figure 5: Block Tableau Inference Rules

    A path in tableau is closed/contradictory if a block on the path contains aformula and its negation.

    A path in tableau is open if no block on the path contains a formula andits negation.

    A tableau is contradictory if every path is contradictory.

    A proof ofA from a set of formulas Ss, Ss A, is a contradictory tableau

    rooted at Ss, A .

    Figure 6 is a tableau for [(p q) (p q)]. The open blocks provide amodel for the formula.

    Figure 7 is a tableau proof of x.[P(x) Q(x)] [x.P(x) x.Q(x)].Since all branches of the tableau are closed, the formula is proved.For efficiency, apply the rules in the following order:

    rule A,

    rule C (but do not reuse a formula until other rules have been applied),

    rule D,

    rule B, and

    place used gamma formulas last in a list of formulas to be used.

    12

  • 7/28/2019 Aaby, Proof Methods in Logic [16 pgs]

    13/16

    [(p q) (p q)]

    |

    (p q), (p q)

    / \p, (p q) q, (p q)

    / \ / \p, p p, q q, p q, q

    closed open open closed

    Figure 6: Tableau for [(p q) (p q)]

    (x.[P(x) Q(x)] [x.P(x) x.Q(x)])

    |

    x.[P(x) Q(x)], [x.P(x) x.Q(x)]

    |

    x.[P(x) Q(x)], x.P(x), x.Q(x)

    |

    x.[P(x) Q(x)], x.P(x), Q(a)

    |

    x.[P(x) Q(x)], P(a), Q(a), x.P(x)

    |

    P(a) Q(a), P(a), Q(a), x.P(x), x.[P(x) Q(x)]

    / \

    P(a), P(a), Q(a), x.P(x), x.[P(x) Q(x)] Q(a), P(a), Q(a), x.P(x), x.[P(x) Q(x

    closed closed

    Figure 7: Tableau for x.[P(x) Q(x)] [x.P(x) x.Q(x)]

    13

  • 7/28/2019 Aaby, Proof Methods in Logic [16 pgs]

    14/16

    Model Construction

    Classical propositional logic has the finite model propertythere is a finite setof finite sets of atomic formulas which determine the truth value of a formula.For example the formula a b is true in either of the two sets in {{a}, {b}}.The tableau method can be used to construct these models. If all branches in

    the tableau are contradictory, the formula is unsatisfiable and any open branchis a model of the formula. Implementationsof the tableaumethod forclassicalpropositionallogic and onefor proposi-tional modallogic is avail-able.

    7 Sequent Systems (Gentzen)

    A sequent is a pair of sets of formulas separated by the turnstile,

    [U V].

    Alternative notations include [U V] and [U V]. The first set, U, is referredto as the antecedent of the sequent and the second set, V is called its succeedent.A sequent corresponds to the assertion that if every formula in U holds, thensome formula in V holds. Symbolically,

    A1 ... Am S1 ... Sn.

    Sequent systems have many inference rules and one logical axiom. The singlelogical axiom is:

    [U, A V, A].

    The inference rules based on the analytic properties of formulas are given inFigure 8.

    A formula is a theorem if it is possible to infer an instance of the axiom.A proof consists of constructing a finite tree of sequents using inference rulesbased on the analytic properties of formulas and natural deduction rules. Eachsequents follows from the immediately preceding sequent by an application ofan inference rule. At the root of the tree is the sequent

    [Axioms, and previously proved theorems Theorem to be proved].

    The tree is constructed by the application of the inference rules (Figure 8).The proof ends if each branch ends with the sequent at the leaf of the form

    [U, A V, A].

    Proofs using theories (a theory is a set of formulas) are implemented insequents by placing the theory on the left and the formula to be proved on theright,

    [Theory Formula].

    The inference rules may be used to construct either direct or indirect proofs.Direct proof: To prove [U T], use the rules breakdown and reassemble the

    14

  • 7/28/2019 Aaby, Proof Methods in Logic [16 pgs]

    15/16

    [U T]

    Initial sequent

    Axiom

    [U, X V, X]

    Final sequent

    Left Rule Right RuleNegation

    [U, F V]

    [U V, F]

    [U V, F]

    [U, F V]

    Rule A

    [U, V]

    [U, 1, 2 V]

    [U V, ]

    [U V, 1, 2]

    Rule B

    [U, V]

    [U, 1 V], [U, 2 V]

    [U V, ]

    [U V, 1], [U V, 2]

    Rule C

    [U, V]

    [U , , (c) V]

    [U V, ]

    [U V,, (c)]

    Any c C

    Rule D

    [U, V]

    [U, (c) V]

    [U V, ]

    [U V, (c)]

    Some c C new to the sequent

    Figure 8: Analytic Sequent Inference Rules

    15

  • 7/28/2019 Aaby, Proof Methods in Logic [16 pgs]

    16/16

    formulas on the left until [U, T T] is derived.Goal oriented proofs: To prove [U B], use both left and right rules tobreakdown and assemble formulas until an instance of the axiom occurs onall branches.

    Different sequent systems are characterized by the set of inference rules andaxioms.

    Example

    Proof of [(A B) C A (B C)][(A B) C, A (B C)]

    [(A B) C,A,B C][C,A,B C] | [A, B A B, C]

    closed | [A, B A, C] | [A, B B, C]closed closed

    An implementation for classical propositional logic is available (code/propseq).An implementation for classical first-order logic is available (code/folseq).

    References

    [1] Beckert, Bernhard and Gore, Rajeev ModLeanTAP i12www.ira.uka.de/modlean

    [2] Beckert, Bernhard and Posegga, Joachim LeanTAP i12www.ira.uka.de/~posegga/leantap/leantap.html

    [3] Fitting, Melvin

    [4] Otten, Jen ileanTAP aida.intellektik.informatik.th-darmstadt.de/~jeotten/ileanTAP

    [5] Smullyan, Raymond M. First-Order Logic Springer-Verlag New York Inc.1968.

    [6] XRefer http://www.xrefer.com/entry/552896Natural Deduction

    16