Using structural induction - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Using structural induction

Description:

It takes the shape of a classic inductive proof: If an infinite set has a definition comprising... For a set of strings X, the notation used above means ... – PowerPoint PPT presentation

Number of Views:109
Avg rating:3.0/5.0
Slides: 11
Provided by: Richard1333
Category:

less

Transcript and Presenter's Notes

Title: Using structural induction


1
Using structural induction
  • Richard Connor

2
Definition of natural numbers
  • Positive whole numbers, greater than or equal to
    zero
  • or
  • Zero is a natural number
  • (Base case)
  • If n is a natural number, then so is n 1
  • (Constructor)
  • Which is the better definition?

3
An Inductive proof example
  • Prove every natural number is finite
  • remember x is finite iff there exists an n such
    that f lt n
  • Consider how to prove this by either definition
  • (hint first definition you cant)
  • Proof by induction over 2nd definition
  • Zero is finite as 1 is greater than zero
  • If x is finite, then there exists a number n such
    that x lt n
  • Therefore there exists a number p n 1, which
    is greater than x 1
  • (if x lt y, then x - 1 lt y - 1)
  • Therefore, if x is finite then x 1 is also
    finite
  • QED (quad erat demonstrandum ie proved

4
Consideration of the proof
  • Looks trivial it isnt
  • It takes the shape of a classic inductive proof
  • If an infinite set has a definition comprising
  • a finite number of rules
  • (the constructors)
  • and a property can be proved for each
    constructor
  • Assuming its true for constructor arguments
  • then a property can be proved for every element
  • of an infinite set.

5
The proof again
Here is the proof for the first constructor
  • Definition of natural numbers (by structural
    induction)
  • Zero is a natural number
  • If n is a natural number, then so is n 1
  • All members of the set are constructed according
    to these rules
  • Proof of finite property by induction
  • Zero is finite as 1 is greater than zero
  • If x is finite, then there exists a number n such
    that x lt n
  • Therefore there exists a number p n 1 which
    is greater than x 1
  • Therefore, if x is finite then x 1 is also
    finite
  • QED (quad erat demonstrandum ie proved

Here is the proof for the second constructor
As there is no other way of constructing one,
this has been proved for the whole (infinite) set
6
An infinite set of strings
  • Define an (infinite) set A by either
  • Any number, including zero, of as concatenated
    together
  • This is a in most regular expression languages
  • ie , a, aa, aaa, aaaa,
  • OR
  • The empty string is an element of set A
  • If s is an element of set A, then so is
  • concatenate( s, a )
  • (or s a, if you prefer)

7
Introducing BNF notation
  • The same set (A) can be defined using a different
    notation as follows
  • ltAgt ?
  • the empty string
  • commonly denoted by ? (epsilon) or
  • ltAgt ltAgta

8
BNF notation (much more later)
  • For a set of strings X, the notation used above
    means something like
  • ltXgt abc
  • abc is a member of X
  • ltYgt ltXgtabc
  • Any member of X followed by abc is a member of Y

9
Binary numbers
  • Consider the set BINARY
  • ltBINARYgt 0
  • ltBINARYgt 1
  • ltBINARYgt ltBINARYgt1
  • ltBINARYgt ltBINARYgt0
  • Exercise refine the definition to exclude
    numbers starting with 0 (apart from 0 itself)

10
More proofs to consider
  • Prove 1101 is an element of BINARY
  • Prove 121 isnt an element of BINARY
  • what kind of software systems commonly perform
    such proofs automatically
  • What is the meaning of 1101?
  • How do you think you might go about defining it?
Write a Comment
User Comments (0)
About PowerShow.com