Inference rule for Induction Let P( ) be a predicate with domain the positive integers BASE CASE INDUCTIVE STEP INDUCTIVE Step: Usually a direct proof Assume P(x) for arbitrary x (Inductive Hypothesis), and show P(x+1) Follows by Universal Generalization
Inference rule for Strong Induction BASE CASES INDUCTIVE STEP INDUCTIVE Step: Usually a direct proof To show P(x+1) for arbitrary x, assume (as Inductive Hypotheses), as many of P(x), P(x-1), P(x-2), P(1) as needed
Recursively Defined Functions Definition: A recursive or inductive definition of a function consists of two steps BASIS STEP: Specify the value of the function at zero RECURSIVE STEP: Give a rule for finding its value at an integer from its values at smaller integers Seen earlier as recurrence relations (e.g., Fibonacci sequence)
Recursively Defined Functions Example: Give a recursive definition of the factorial function n! Example: Give a recursive definition of n å k = 0 a k.
Recursively Defined Sets and Structures Recursive definitions of sets have the following parts: The basis step specifies an initial collection of elements The recursive step gives the rules for forming new elements in the set from those already known to be in the set An exclusion rule specifies that the set contains nothing other than those elements specified in the basis step and generated by applications of the rules in the recursive step. (This is sometimes assumed and not stated.)
Recursively Defined Sets and Structures Example : Subset of Integers S: BASIS STEP: 3 S. RECURSIVE STEP: If x S and y S, then x + y is in S. Defines the set of all positive integer multiples of 3 Example: The natural numbers N: BASIS STEP: 0 N. RECURSIVE STEP: If n is in N, then n + 1 is in N.
Well-Formed Formulae in Propositional Logic Definition: The set of well-formed formulae (WFFs) in propositional logic involving T, F, propositional variables, and operators from the set {,,,, }. BASIS STEP: T,F, and s, where s is a propositional variable, are well-formed formulae. RECURSIVE STEP: If E and F are well formed formulae, then ( E), (E F), (E F), (E F), (E F), are well-formed formulae. Examples: ((p q) (q F)) is a well-formed formula. pq is not a well formed formula.
Structural Induction To prove a property of the elements of a recursively defined set, we show the following two steps. BASIS STEP: Show that the result holds for all elements specified in the basis step of the recursive definition. INDUCTIVE STEP: Show that if the statement is true for each of the elements used to construct new elements in the recursive step of the definition, the result holds for these new elements.
Structural Induction Example Prove that every well-formed formula (WFF) in propositional logic contains an equal number of left and right parentheses BASIS STEP: Each of T,F, and s contains an equal number (zero) of left and right parentheses INDUCTIVE STEP: Assume E and F are WFFs that, by the inductive hypothesis, each contain an equal number of left and right parentheses. We must show that each of ( E), (E F), (E F), (E F), and (E F) contain an equal number of left and right parentheses
Revisiting Recursively Defined Functions Definition: A recursive or inductive definition of a function consists of two steps BASIS STEP: Specify the value of the function at zero RECURSIVE STEP: Give a rule for finding its value at an integer from its values at smaller integers A generalization Example 13 (page 377)
GENERALIZED INDUCTION Can be used to prove properties of functions from other domains that possess the well-ordering property (Every nonempty subset of the set has a minimum element) Example: Ordered pairs of non-negative integers Lexicographic ordering (x 1, y 1 ) < (x 2, y 2 ): (x 1 < x 2 ) or (x 1 =x 2 and y 1 < y 2 ) Example 13 (page 377)
GENERALIZED INDUCTION
GENERALIZED INDUCTION The Ackermann function (as per the text)