Notes Chapter09

download Notes Chapter09

of 12

Transcript of Notes Chapter09

  • 7/28/2019 Notes Chapter09

    1/12

    C H A P T E R 9

    Induction

    9.1 Introduction

    Induction is reasoning from the specific to the general. If various instances of a schema are trueand there are no counterexamples, we are tempted to conclude a universally quantified version ofthe schema.

    p(a) q(a)

    p(b) q(b) x.p(x) q(x)

    p(c) q(c)

    Incomplete induction is induction where the set of instances is not exhaustive. From a reasonablecollection of instances, we sometimes leap to the conclusion that a schema is always true eventhough we have not seen all instances. Consider, for example, the functionfwheref(1)=1, and

    f(n+1)=f(n) + 2n + 1. If we look at some values of this function, we notice a certain regularity - thevalue offalways seems to be the square of its input. From this sample, we are tempted to leap to

    the conclusion thatf(n)=n2. Lucky guess. In this case, the conclusion happens to be true; and wecan prove it.

    n f(n) n2

    1 1 12 4 22

    3 9 32

    4 16 42

    5 25 52

    Here is another example. This one is due to the mathematician Fermat (1601-1665). He looked at

    values of the expression 22n

    + 1 for various values ofn and noticed that they were all prime. So, heconcluded the value of the expression was prime number. Unfortunately, this was not a lucky

    guess. His conjecture was ultimately disproved, in fact with the very next number in the sequence.

    n 22n+1 Prime?

    1 5 Yes

    17 4 Yes

    257 9 Yes

    65537 16 Yes

    For us, this is not so good. In Logic, we are concerned with logical entailment. We want to derive

  • 7/28/2019 Notes Chapter09

    2/12

    only conclusions that are guaranteed to be true when the premises are true. Guesses like these areuseful in suggesting possible conclusions, but they are not themselves proofs. In order to be sureof universally quantified conclusions, we must be sure that all instances are true. This is calledcomplete induction. When applied to numbers, it is usually called mathematical induction.

    The techniques for complete induction vary with the structure of the language to which it isapplied. We begin this chapter with a discussion of domain closure, a rule that applies when theHerbrand base of our language is finite. We then move on to linear induction, i.e. the special casein which the ground terms in the language form a linear sequance. After that, we look at tree

    induction, i.e. the special case in which the ground terms of the language form a tree. Finally, welook at structural induction, which applies to all languages.

    9.2 Finite Induction

    First let's consider the case for finite languages. Induction for finite languages is simple. If webelieve a schema is true for every instance, then we can infer a universally quantified version ofthat schema. In other words, we have the following rule of inference, called Finite DomainClosure.

    For a language with object constants 1, ... , n, the rule is written as shown below. If we believe aschema is true for every instance, then we can infer a universally quantified version of thatschema.

    [1]

    ...

    [n]

    .[]

    Recall that, in our formalization of the Sorority World, we have just four constants - abby, bess,cody, and dana. For this language, we would have the following Finite Domain Closure rule.

    Finite Domain Closure (DC)

    [abby]

    [bess]

    [cody]

    [dana]

    .[]

    The following proof shows how we can use this rule to derive an inductive conclusion. Given thepremises we considered earlier in this book, it is possible to infer that Abby likes someone, Besslikes someone, Cody likes someone, and Dana likes someone. Taking these conclusions aspremises and using our Finite Domain Closure rule, we can then derive the inductive conclusionx.y.likes(x,y), i.e. everybody likes somebody.

  • 7/28/2019 Notes Chapter09

    3/12

    1. y.likes(abby,y) Premise

    2. y.likes(bess,y) Premise

    3. y.likes(cody,y) Premise

    4. y.likes(dana,y) Premise

    5. x.y.likes(x,y) DC: 1, 2, 3, 4

    Unfortunately, this technique does not work when there are infinitely many ground terms.

    Suppose, for example, we have a language with ground terms 1, 2, ... A direct generalization ofthe Finite Domain Closure rule is shown below.

    [1]

    [2]

    ...

    .[]

    This rule is sound in the sense that the conclusion of the rule is logically entailed by the premisesof the rule. However, it does not help us produce a proof of this conclusion. To use the rule, weneed to prove all of the rule's premises. Unfortunately, there are infinitely many premises. So, therule cannot be used in generating a finite proof.

    All is not lost. It is possible to write rules that cover all instances without enumerating themindividually. The method depends on the structure of the language. The next sections describe howthis can be done for languages with different structures.

    9.3 Linear Induction

    Consider a language with a single object constant a and a single unary function constant s. There

    are infinitely many ground terms in this language, arranged in what resembles a straight line. Seebelow. Starting from the object constant, we move to a term in which we apply the functionconstant to that constant, then to a term in which we apply the function constant to that term, andso forth.

    as(a) s(s(a)) s(s(s(a))) ...

    In this section, we concentrate on languages that have linear structure of this sort. Hereafter, wewe call these linear languages. In all cases, there is a single object constant and a single unaryfunction constant. In talking about a linear language, we call the object constant the base elementof the language, and we call the unary function constant the successor function.

    Although there are infinitely many ground terms in any linear language, we can still generate finiteproofs that are guaranteed to be correct. The trick is to use the structure of the terms in thelanguage in expressing the premises of an inductive rule of inference known as linear induction.See below for a statement of the induction rule for the language introduced above. In general, ifwe know that a schema holds of our base element and if we know that, whenever the schema holdsof an element, it also holds of the successor of that element, then we can conclude that the schemaholds of all elements.

  • 7/28/2019 Notes Chapter09

    4/12

    Linear Induction

    [a]

    .([] [s()]

    .[]

    A bit of terminology before we go on. The first premise in this rule is called the base case of theinduction, because it refers to the base element of the language. The second premise is called theinductive case. The antecedent of the inductive case is called the inductive hypothesis, and theconsequent is called, not surprisingly, the inductive conclusion. The conclusion of the rule issometimes called the overall conclusion to distinguish it from the inductive conclusion.

    For the language introduced above, our rule of inference is sound. Suppose we know that a schemais true ofa and suppose that we know that, whenever the schema is true of an arbitrary groundterm , it is also true of the term s(). Then, the schema must be true of everything, since there areno other terms in the language.

    The requirement that the signature consists of no other object constants or function constants iscrucial. If this were not the case, say there were another object constant b, then we would have

    trouble. It would still be true that holds for every element in the set {a, s(a), s(s(a)),...}.However, because there are other elements in the Herbrand universe, e.g. b and s(b), x.(x)would no longer be guaranteed.

    In order to understand the intuition behind linear induction, imagine an infinite set of dominoesplaced in a line so that, when one falls, the next domino in the line also falls. If the first dominofalls, then the second domino falls. If the second domino falls, then the third domino falls. And soforth. By continuing this chain of reasoning, it is easy for us to convince ourselves that everydomino eventually falls.

    Now, let's formalize this example and prove this result using induction. Let a represent the first

    domino. And let s represent the relationship between a domino and the next domino in line. Let'suse the unary relation constantfalls to express the fact that the domino given as argumenteventually falls.

    A one-step proof of our conclusion that all of the dominoes eventually fall is shown below. Westart with the premise that the first domino in the line falls. We also have the premise that thedominoes are so placed so that each domino knocks over the next domino. These two sentencesmatch the premises of the linear induction rule, and so we can derive the conclusion.

    1. falls(a) Premise

    2. x.(falls(x) falls(s(x)) Premise

    3. x.(falls(x)) Ind: 1, 2

    Here is a more interesting example. Recall the formalization of Arithmetic introduced in Chapter6. Using the object constant 0 and the unary function constant s, we represent each number n byapplying the function constant to 0 exactly n times. We also have a single ternary relation constant

    plus to represent the addition table.

    The following axioms describeplus in terms of 0 and s. The first sentence here says that adding 0

  • 7/28/2019 Notes Chapter09

    5/12

    to any element produces that element. The second sentence states that adding the successor of anumber to another number yields the successor of their sum.

    y.plus(0,y,y)

    x.y.z.(plus(x,y,z) plus(s(x),y,s(z)))

    It is easy to see that any table that satisfies these axioms includes all of the usual addition facts.The first axioms ensures that all cases with 0 as first arg are included. From this fact and the

    second axiom, we can see that all cases with s(0) as first argument are included. And so forth. Inorder for our description to be a complete definition, we would also need an axiom limiting thevalue ofplus (its third argument) to a single value for each pair on inputs (its first two arguments).However, we do not need that axiom for the purposes of this example; and so, for the sake ofsimplicity, we skip it.

    The first axiom above tells us that 0 is a left identity for addition - 0 added to any number producesthat number as result. As it turns out, given these definitions, 0 must also be a right identity, i.e itmust be the case that x.plus(x,0,x).

    We can use induction to prove this result as shown below. We start with our premises. We use

    Universal Elimination on the first premise to derive the sentence on line 3. This takes care of thebase case of our induction. We then start a subproof and assume the antecedent of the inductivecase. We then use three applications of Universal Elimination on the second premise to get thesentence on line 5. We use Implication Elimination on this sentence and our assumption to derivethe conclusion on line 6. We then discharge our assumption and form the implication shown online 7 and then universalize this to get the result on line 8. Finally, we use linear induction toderive our overall conclusion.

    1. y.plus(0,y,y) Premise

    2. x.y.z.(plus(x,y,z) plus(s(x),y,s(z))) Premise

    3. plus(0,0,0) UE: 1

    4. plus(x,0,x) Assumption

    5. plus(x,0,x) plus(s(x),0,s(x)) 3 x UE: 2

    6. plus(s(x),0,s(x)) IE: 5, 4

    7. plus(x,0,x) plus(s(x),0,s(x)) II: 4, 6

    8. x.(plus(x,0,x) plus(s(x),0,s(x))) UI: 7

    9. x.plus(x,0,x) Ind: 3, 8

    9.4 Tree Induction

    Tree languages are a superset of linear languages. While, in linear languages, the terms in thelanguage form a linear sequence, in tree languages the structure is more tree-like. Consider alanguage with an object constant a and two unary function constantsfand g. Some of the terms inthis language are shown below.

  • 7/28/2019 Notes Chapter09

    6/12

    a

    f(a) g(a)

    f(f(a)) g(f(a)) f(g(a)) g(g(a))

    As with linear languages, we can write an inductive rule of inference for tree languages. The treeinduction rule of inference for the language just described is shown below. Suppose we know thata schema holds ofa. Suppose we know that, whenever the schema holds of any element, it holdsof the term formed by applyingfto that element. And suppose we know that, whenever theschema holds of any element, it holds of the term formed by applying g to that element. Then, wecan conclude that the schema holds of every element.

    Tree Induction

    [a]

    .([] [f()])

    .([]

    [g()])

    .[]

    In order to see an example of tree induction in action, consider the ancestry tree for a particulardog. We use the object constant rex to refer to the dog; we use the unary function constantfmapan arbitrary dog to its father; and we use g map a dog to its mother. Finally, we have a singleunary relation constantpurebredthat is true of a dog if and only if it is purebred.

    Now, we write down the fundamental rule of dog breeding - we say that a dog is purebred if andonly if both its father and its mother are purebred. See below. (This is a bit oversimplified onseveral grounds. Properly, the father and mother should be of the same breed. Also, thisformalization suggests that every dog has an ancestry tree that stretches back without end.However, let's ignore these imperfections for the purposes of our example.)

    x.(purebred(x) purebred(f(x)) purebred(g(x)))

    Suppose now that we discover the fact that our dog rex is purebred. Then, we know that every dogin his ancestry tree must be purebred. We can prove this by a simple application of tree induction.

    A proof of our conclusion is shown below. We start with the premise that Rex is purebred. Wealso have our constraint on purebred animals as a premise. We use Universal Elimination to

    instantiate the second premise, and then we use Biconditional Elimination on the biconditional inline 3 to produce the implication on line 4. On line 5, we start a subproof with the assumption the xis purebred. We use Implication Elimination to derive the conjunction on line 6, and then we useAnd Elimination to pick out the first conjunct. We then use Implication Introduction to dischargeour assumption, and we Universal Introduction to produce the inductive case forf. We then repeatthis process to produce an analogous result for g on line 14. Finally, we use the tree induction ruleon the sentences on lines 1, 9, and 14 and thereby derive the desired overall conclusion.

  • 7/28/2019 Notes Chapter09

    7/12

    1. purebred(rex) Premise

    2. x.(purebred(x) purebred(f(x)) purebred(g(x))) Premise

    3. purebred(x) purebred(f(x)) purebred(g(x)) UE: 2

    4. purebred(x) purebred(f(x)) purebred(g(x)) BE: 3

    5. purebred(x) Assumption

    6. purebred(f(x))

    purebred(g(x)) IE: 4, 6

    7. purebred(f(x)) AE: 6

    8. purebred(x) purebred(f(x)) II: 5, 7

    9. x.purebred(x) purebred(f(x)) UI: 8

    10. purebred(x) Assumption

    11. purebred(f(x)) purebred(g(x)) IE: 4, 6

    12. purebred(g(x)) AE: 7

    13. purebred(x) purebred(g(x)) II: 6, 8

    14. x.purebred(x) purebred(g(x)) UI: 9

    15. x.purebred(x) Ind: 1, 9, 14

    9.5 Structural Induction

    Structural induction is the most general form of induction. In structural induction, we can havemultiple object constants, multiple function constants, and, unlike our other forms of induction, we

    can have function constants with multiple arguments. Consider a language with two objectconstants a and b and a single binary function constant c. See below for a list of some of the termsin the language. We do not provide a graphical rendering in this case, as the structure is morecomplicated than a line or a tree.

    a, b, c(a,a), c(a,b), c(b,a), c(b,b), c(a,c(a,a)), c(c(a,a),a), c(c(a,a),c(a,a)), ...

    The structural induction rule for this language is shown below. If we know that holds of ourbase elements a and b and if we know ..(([] []) [c(,)]), then we can conclude.[] in a single step.

    Structural Induction

    [a]

    [b]

    ..(([] []) [c(,)])

    .[]

    In order to visualize a world where structural induction is appropriate, let's transport ourselves to aprimitive chemistry laboratory. In the lab, we have two liquids, and we have enough equipment to

  • 7/28/2019 Notes Chapter09

    8/12

    combine the liquids in various ways, to combine the combinations with each other, and so forth.Back in Logic land, our goal is to prove things about the acidity of the combinations we can createin the laboratory.

    Let's use the object constant a to represent one liquid, and let's use b to represent the second liquid.Let the binary function constant c represent the result of combining two liquids designated by itsarguments. Finally, let's use the unary relation constant acidto express the fact that a liquid is anacid; let's use the unary relation constant neutexpress the fact that a liquid is neutral; let's use theunary relation constant base express the fact that a liquid is a base.

    Now for our premises. We know that mixing two acids yields an acid. We know that mixing anacid and a neutral liquid yields an acid, and vice versa. We know that mixing two neutral liquidsyields a neutral result. We know that mixing a base and a neutral liquid yields a base, and viceversa. We know that mixing two bases yields a base. It is unclear what happens when we mixacids and bases; it depends on their concentrations.

    x.y.(acid(x) acid(y) acid(c(x,y))

    x.y.(acid(x) neut(y) acid(c(x,y))

    x.y.(neut(x) acid(y) acid(c(x,y))

    x.y.(neut(x) neut(y) neut(c(x,y))

    x.y.(base(x) base(y) base(c(x,y))

    x.y.(base(x) neut(y) base(c(x,y))

    x.y.(neut(x) base(y) base(c(x,y))

    As a simple example of structural induction in action, let's prove that, if both of our liquids areacids, then every combination is an acid as well. In other words, given acid(a) and acid(b), wewant to prove the conclusion x.acid(x).

    The proof in this case is trivial. We have our specific facts about a and b, and we have our generalfact about the combination of two acids. These three items match the premises of the structuralinduction rule, and so we can derive our conclusion in one step.

    1. acid(a) Premise

    2. acid(b) Premise

    3. x.y.(acid(x) acid(y) acid(c(x,y)) Premise

    2. x.acid(x) Ind: 1, 2, 3

    Now, let's see what happens when one of our liquids is an acid and the other is a neutral liquid.Clearly, we can now have pure acids or pure neutral liquids or any mix of the two. The result isguaranteed to be either an acid or neutral, but that's all we can say. In other words, if we know thatacid(a) and neut(b), then the best we can do is to prove x.(acid(x) neut(x)).

    As with our last example, we can prove this result using structural induction. The proof in thiscase is a lot messier, but it is worth seeing as it suggests the sort of complexity that is involved ininductive proofs with disjunctive conclusions. Because the proof is so messy, we show it insegments. As usual, we start with our premises. Note that we could include all of our facts aboutcombinations; but, since we do not have any bases, we can omit our general facts about

  • 7/28/2019 Notes Chapter09

    9/12

    combinations involving bases.

    1. acid(a) Premise

    2. neut(b) Premise

    3. x.y.(acid(x) acid(y) acid(c(x,y)) Premise

    4. x.y.(acid(x) neut(y) acid(c(x,y)) Premise

    5. x.y.(neut(x) acid(y) acid(c(x,y)) Premise

    6. x.y.(neut(x) neut(y) neut(c(x,y)) Premise

    As before, we deal with the base cases first. We use Or Introduction to disjoin our first twopremises with other sentences so that the resulting disjunctions match the first two premises ofstructural induction for our desired result.

    7. acid(a) neut(a) OI: 1

    8. acid(b) neut(b) OI: 2

    Now, we prove x.y.((acid(x) neut(x)) (acid(y) neut(y)) acid(c(x,y)) neut(c(x,y))). To

    this end, we start a new proof and assume the inductive hypothesis, and we use And Elimination tosplit the conjunction into its components.

    9. (acid(x) neut(x)) (acid(y) neut(y)) Assumption

    10. acid(x) neut(x) AE: 9

    11. acid(y) neut(y) AE: 9

    In order to prove the inductive case, using our assumption, we need to show the intermediateconclusion. acid(c(x,y)) neut(c(x,y)). Our plan for doing this to show that this conclusion follows

    from acid(x) and that it follows from neut(x). Then we can use Or Elimination on the disjunctionin line 10 to derive the inductive conclusion.

    In the segment below, we see the proof for the first of these two cases. We assume acid(x); and,using that assumption, we derive acid(c(x,y)) neut(c(x,y)). We then use Implication Introduction

    to derive the first result we need for our application of Or Elimination.

  • 7/28/2019 Notes Chapter09

    10/12

    12. acid(x) Assumption

    13. acid(y) Assumption

    14. acid(x) acid(y) AI: 12, 13

    15. acid(x) acid(y) acid(c(x,y)) 2 x UE: 3

    16. acid(c(x,y)) IE: 15, 14

    17.acid(y) acid(c(x,y))

    II: 13, 16

    18. neut(y) Assumption

    19.acid(x) neut(y)

    AI: 12, 18

    20. acid(x) neut(y) acid(c(x,y)) 2 x UE: 4

    21. acid(c(x,y)) IE: 20, 19

    22. neut(y) acid(c(x,y)) II: 18, 20

    23. acid(c(x,y)) OE:11,17,22

    24. acid(c(x,y)) neut(c(x,y)) OI: 23

    25. acid(x) acid(c(x,y)) neut(c(x,y)) II: 12, 24

    In the next segment below, we see the proof for the second of the cases needed for Or Elmination.We assume neut(x); and, using that assumption, we derive acid(c(x,y)) neut(c(x,y)). We again

    use Implication Introduction to derive the necessary result.

  • 7/28/2019 Notes Chapter09

    11/12

    26. neut(x) Assumption

    27. acid(y) Assumption

    28. neut(x) acid(y) AI: 26, 27

    29. neut(x) acid(y) acid(c(x,y)) 2 x UE: 5

    30. acid(c(x,y)) IE: 29, 28

    31.acid(c(x,y)) neut(c(x,y))

    OI: 30

    32. acid(y) acid(c(x,y)) neut(c(x,y)) II: 27, 31

    33. neut(y) Assumption

    34. neut(x) neut(y) AI: 26, 33

    35. neut(x) neut(y) neut(c(x,y)) 2 x UE: 6

    36. neut(c(x,y)) IE: 35, 34

    37. acid(c(x,y)) neut(c(x,y)) OI: 36

    38. neut(y) acid(c(x,y)) neut(c(x,y)) II: 33, 36

    39. acid(c(x,y)) neut(c(x,y)) OE:11,32,38

    40. neut(x) acid(c(x,y)) neut(c(x,y)) II: 26, 39

    Now, we have the pieces we need - the disjunction on line 10 and the implications on lines 25 and40. Using OE, we derive the result on line 42, and then we use UI to universalize this result.

    41.acid(c(x,y)) neut(c(x,y))

    OE:10,25,4042.(acid(x) neut(x)) (acid(y) neut(y)) acid(c(x,y)) neut(c(x,y)) II: 9, 41

    43.x.y.((acid(x) neut(x)) (acid(y) neut(y)) acid(c(x,y)) neut(c(x,y)))2 x UI: 42

    Finally, we put all of the pieces together - the two base cases and this inductive case - and weapply the structural induction rule to produce the desired conclusion.

    44. x.(acid(x) neut(x)) Ind: 7, 8, 43

    Although our proof in this case is messier than in the last case, the basic inductive structure is thesame. Importantly, using induction, we can are able to prove this result where otherwise it wouldnot be possible.

    Recap

    Induction is reasoning from the specific to the general. Complete induction is induction where theset of instances is exhaustive.Incomplete induction is induction where the set of instances is notexhaustive.Linear induction is a type of complete induction for languages with a single objectconstants and a single unary function constant. Tree induction is a type of complete induction for

  • 7/28/2019 Notes Chapter09

    12/12

    languages with a single object constants and multiple unary function constants. Structuralinduction is a generalization of both linear and tree induction that works even in the presence ofmultiple object constants and multiple n-ary function constants.