ii recursive function
play

II. Recursive Function Yuxi Fu BASICS, Shanghai Jiao Tong - PowerPoint PPT Presentation

II. Recursive Function Yuxi Fu BASICS, Shanghai Jiao Tong University Hilberts Program The epochal address of David Hilbert (23Jan.1862-14Feb.1934) to the International Congress of Mathematicians (Paris, 1900): 1. Consistency of the Axioms of


  1. II. Recursive Function Yuxi Fu BASICS, Shanghai Jiao Tong University

  2. Hilbert’s Program The epochal address of David Hilbert (23Jan.1862-14Feb.1934) to the International Congress of Mathematicians (Paris, 1900): 1. Consistency of the Axioms of Arithmetic. This is the second among Hilbert’s 23 problems published in 1900 (ten were announced in the Paris Congress). 2. Entscheidungsproblem (decision problem) of first order logic. Yuxi Fu II. Recursive Function 1 / 49

  3. G¨ odel’s Incompleteness Theorem Hilbert retired in 1930, and gave a special speech to the annual meeting of the Society of German Scientists and Physicians in his birth place, K¨ onigsberg. It was in this occasion he made his famous remark ”Wir m¨ ussen wissen. Wir werden wissen.” odel (28April.1906-14Jan.1978), a young man from Vienna Kurt G¨ and one year past his PhD, announced his Incompleteness Theorem in a roundtable discussion at the Conference on Epistemology held jointly with the Society meetings. (one day before Hilbert’s speech!) Yuxi Fu II. Recursive Function 2 / 49

  4. History of Recursion Theory G¨ odel’s remarkable idea is the arithmetization of syntax. He used primitive recursive functions to do encoding. In 1931 G¨ odel was aware of the Ackermann function. By taking a suggestion from Herbrand, he developed in 1934 a formal system of Herbrand-G¨ odel recursive functions. Kleene (5Jan.1909-25Jan.1994) introduced in 1936 the µ -recursive functions, based on the system of the primitive recursive functions and an unbounded search operator. Yuxi Fu II. Recursive Function 3 / 49

  5. Synopsis 1. Primitive Recursive Function 2. Ackermann Function 3. Recursive Function Yuxi Fu II. Recursive Function 4 / 49

  6. 1. Primitive Recursive Function Yuxi Fu II. Recursive Function 5 / 49

  7. Recursion Theory offers a mathematical model for the study of effective calculability. ◮ All effective objects can be encoded by natural numbers. ◮ All effective procedures can be modeled by functions from numbers to numbers. Yuxi Fu II. Recursive Function 6 / 49

  8. Initial Function 1. The zero function 0 def = λ x 1 . . . λ x n . 0. 2. The successor function s( x ) def = λ x . x +1. i ( x 1 , . . . , x n ) def 3. The projection function U n = λ x 1 . . . λ x n . x i . Yuxi Fu II. Recursive Function 7 / 49

  9. Composition Suppose f ( y 1 , . . . , y k ) is a k -ary function and g 1 ( � x ) , . . . , g k ( � x ) are n -ary functions, where � x abbreviates x 1 , . . . , x n . The composition function h ( � x ) is defined by h ( � x ) = f ( g 1 ( � x ) , . . . , g k ( � x )) , Yuxi Fu II. Recursive Function 8 / 49

  10. Recursion Suppose that f ( � x ) is an n -ary function and g ( � x , y , z ) is an ( n +2)-ary function. The recursion function h ( � x ) is defined by h ( � x , 0) = f ( � x ) , (1) h ( � x , y + 1) = g ( � x , y , h ( � x , y )) . (2) Clearly there is a unique function that satisfies (1) and (2). Yuxi Fu II. Recursive Function 9 / 49

  11. Primitive Recursive Recursion The set of primitive recursive function is the least set generated from the initial functions, composition and recursion. Yuxi Fu II. Recursive Function 10 / 49

  12. Dummy Parameter Proposition . Suppose that f ( y 1 , . . . , y k ) is a primitive recursive and that x i 1 , . . . , x i k is a sequence of k variables from x 1 , . . . , x n (possibly with repetition). Then the function h given by h ( x 1 , . . . , x n ) = f ( x i 1 , . . . , x i k ) is primitive recursive. Proof. x ) = f (U n x ) , . . . , U n h ( � i 1 ( � i k ( � x )). Yuxi Fu II. Recursive Function 11 / 49

  13. Basic Arithmetic Function x + y : x + 0 = x , x + ( y + 1) = ( x + y ) + 1 . xy : x 0 = 0 , x ( y + 1) = xy + x . x y : x 0 = 1 , x y +1 x y x . = Yuxi Fu II. Recursive Function 12 / 49

  14. Basic Arithmetic Function x ˙ − 1: 0 ˙ − 1 = 0 , ( x + 1) ˙ − 1 = x . � x − y , if x ≥ y , − y def x ˙ = otherwise . : 0 , x ˙ − 0 = x , x ˙ ( x ˙ − y ) ˙ − ( y + 1) = − 1 . Yuxi Fu II. Recursive Function 13 / 49

  15. Basic Arithmetic Function � 0 , if x = 0 , sg( x ) def = if x � = 0 . : 1 , sg(0) = 0 , sg( x + 1) = 1 . � 1 , if x = 0 , sg( x ) def = if x � = 0 . : 0 , sg( x ) = 1 ˙ − sg( x ) . Yuxi Fu II. Recursive Function 14 / 49

  16. Basic Arithmetic Function | x − y | = ( x ˙ − y ) + ( y ˙ − x ). x !: 0! = 1 , ( x + 1)! = x !( x + 1) . min( x , y ) = x ˙ − ( x ˙ − y ). max( x , y ) = x + ( y ˙ − x ). Yuxi Fu II. Recursive Function 15 / 49

  17. Basic Arithmetic Function rm( x , y ) def = the remainder when y is devided by x : � rm( x , y ) + 1 if rm( x , y ) + 1 < x , def rm( x , y + 1) = 0 , otherwise . The recursive definition is given by rm( x , 0) = 0 , (rm( x , y ) + 1) sg ( x ˙ rm( x , y + 1) = − (rm( x , y ) + 1)) . Yuxi Fu II. Recursive Function 16 / 49

  18. Basic Arithmetic Function qt( x , y ) def = the quotient when y is devided by x : � qt( x , y ) + 1 , if rm( x , y ) + 1 = x , def qt( x , y + 1) = qt( x , y ) , if rm( x , y ) + 1 � = x . The recursive definition is given by qt( x , 0) = 0 , qt( x , y + 1) , = qt( x , y ) + sg ( x − (rm( x , y ) + 1)) . Yuxi Fu II. Recursive Function 17 / 49

  19. Basic Arithmetic Function � 1 , if x divides y , div( x , y ) def = : 0 , otherwise . div( x , y ) = sg (rm( x , y )). Yuxi Fu II. Recursive Function 18 / 49

  20. Bounded Sum and Bounded Product Bounded sum: � f ( � x , y ) = 0 , y < 0 � � f ( � x , y ) = f ( � x , y ) + f ( � x , z ) . y < z +1 y < z Bounded product: � f ( � x , y ) = 1 , y < 0 � � f ( � x , y ) = ( f ( � x , y )) · f ( � x , z ) . y < z +1 y < z Yuxi Fu II. Recursive Function 19 / 49

  21. Bounded Sum and Bounded Product By composition the following functions are also primitive recursive if k ( � x , � w ) is primitive recursive: � f ( � x , z ) z < k ( � w ) x , � and � f ( � x , z ) . z < k ( � x , � w ) Yuxi Fu II. Recursive Function 20 / 49

  22. Bounded Minimization Operator Bounded search: � the least z < y , such that f ( � x , z ) = 0; def µ z < y ( f ( � x , z ) = 0) = y , if there is no such z . Yuxi Fu II. Recursive Function 21 / 49

  23. Bounded Minimization Operator Bounded search: � the least z < y , such that f ( � x , z ) = 0; def µ z < y ( f ( � x , z ) = 0) = y , if there is no such z . Proposition . If f ( � x , z ) is primitive recursive, then so is µ z < y ( f ( � x , z ) = 0). Proof. x , z ) = 0) = � v < y ( � µ z < y ( f ( � u < v +1 sg( f ( � x , u ))). Yuxi Fu II. Recursive Function 21 / 49

  24. Bounded Minimization Operator If f ( � x , z ) and k ( � w ) are primitive recursive functions, then so is x , � the function µ z < k ( � x , � w )( f ( � x , z ) = 0) . Yuxi Fu II. Recursive Function 22 / 49

  25. Primitive Recursive Predicate Suppose M ( x 1 , . . . , x n ) is an n -ary predicate of natural numbers. The characteristic function c M ( � x ), where � x = x 1 , . . . , x n , is � 1 , if M ( a 1 , . . . , a n ) holds , c M ( a 1 , . . . , a n ) = 0 , if otherwise . The predicate M ( � x ) is primitive recursive if c M is primitive recursive. Yuxi Fu II. Recursive Function 23 / 49

  26. Closure Property Proposition . The following statements are valid: ◮ If R ( � x ) is a primitive recursive predicate, then so is ¬ R ( � x ). ◮ If R ( � x ) , S ( � x ) are primitive recursive predicates, then the following predicates are primitive recursive: ◮ R ( � x ) ∧ S ( � x ); ◮ R ( � x ) ∨ S ( � x ). ◮ If R ( � x , y ) is a primitive recursive predicate, then the following predicates are primitive recursive: ◮ ∀ z < y . R ( � x , z ); ◮ ∃ z < y . R ( � x , z ). Proof. x , y ) = � For example c ∀ z < y . R ( � x , z ) ( � z < y c R ( � x , z ). Yuxi Fu II. Recursive Function 24 / 49

  27. Definition by Case Suppose that f 1 ( � x ) , . . . , f k ( � x ) are primitive recursive functions, and M 1 ( � x ) , . . . , M k ( � x ) are primitive recursive predicates, such that for every � x exactly one of M 1 ( � x ) , . . . , M k ( � x ) holds. Then the function g ( � x ) given by  f 1 ( � x ) , if M 1 ( � x ) holds ,     f 2 ( � x ) , if M 2 ( � x ) holds , g ( � x ) = . .  .    f k ( � x ) , if M k ( � x ) holds . is primitive recursive. Proof. g ( � x ) = c M 1 ( � x ) f 1 ( � x ) + . . . + c M k ( � x ) f k ( � x ). Yuxi Fu II. Recursive Function 25 / 49

  28. More Arithmetic Function Proposition . The following functions are primitive recursive. (i) D ( x ) = the number of divisors of x ; � 1 , if x is prime , (ii) Pr ( x ) = if x is not prime . ; 0 , (iii) p x = the x -th prime number;  k , k is the exponent of p y in the prime  (iv) ( x ) y = factorisation of x , for x , y > 0 , .  0 , if x = 0 or y = 0 . Yuxi Fu II. Recursive Function 26 / 49

  29. More Arithmetic Function Proof. (i) D ( x ) = � y < x +1 div ( y , x ). (ii) Pr ( x ) = sg( | D ( x ) − 2 | ). (iii) p x can be recursively defined as follows: p 0 = 0 , � � 1 ˙ − ( z ˙ p x +1 = µ z < (2 + p x !) − p x ) Pr ( z ) = 0 . (iv) ( x ) y = µ z < x ( div (p z +1 , x ) = 0). y Yuxi Fu II. Recursive Function 27 / 49

Recommend


More recommend