fundamentele informatica 3
play

Fundamentele Informatica 3 Definition 10.1. Initial Functions The - PDF document

A slide from lecture 12: Fundamentele Informatica 3 Definition 10.1. Initial Functions The initial functions are the following: voorjaar 2014 1. Constant functions: For each k 0 and each a 0, the a : N k N is defined by the formula


  1. A slide from lecture 12: Fundamentele Informatica 3 Definition 10.1. Initial Functions The initial functions are the following: voorjaar 2014 1. Constant functions: For each k ≥ 0 and each a ≥ 0, the a : N k → N is defined by the formula constant function C k http://www.liacs.nl/home/rvvliet/fi3/ C k for every X ∈ N k a ( X ) = a Rudy van Vliet kamer 124 Snellius, tel. 071-527 5777 2. The successor function s : N → N is defined by the formula rvvliet(at)liacs(dot)nl s ( x ) = x + 1 college 14, 12 mei 2014 3. Projection functions: For each k ≥ 1 and each i with 1 ≤ i : N k → N is defined by the 10. Computable Functions i ≤ k , the projection function p k 10.2. Quantification, Minimalization, and µ -Recursive formula Functions p k i ( x 1 , x 2 , . . . , x k ) = x i 10.3. G¨ odel Numbering 1 2 A slide from lecture 12: A slide from lecture 12: Definition 10.2. The Operations of Composition and Primitive Recursion (continued) Definition 10.2. The Operations of Composition and Primitive Recursion 2. Suppose n ≥ 0 and g and h are functions of n and n + 2 variables, respectively. (By “a function of 0 variables,” we 1. Suppose f is a partial function from N k to N , and for each i mean simply a constant.) with 1 ≤ i ≤ k , g i is a partial function from N m to N . The function obtained from g and h by the operation of primitive recursion is the function f : N n +1 → N defined by The partial function obtained from f and g 1 , g 2 , . . . , g k by composition is the partial function h from N m to N defined the formulas by the formula f ( X, 0) = g ( X ) h ( X ) = f ( g 1 ( X ) , g 2 ( X ) , . . . , g k ( X )) for every X ∈ N m f ( X, k + 1) = h ( X, k, f ( X, k )) for every X ∈ N n and every k ≥ 0. 3 4 A slide from lecture 12: Theorem 10.4. A slide from lecture 12: Every primitive recursive function is total and computable. n -place predicate P is function from N n to { true , false } characteristic function χ P defined by � 1 if P ( X ) is true χ P ( X ) = 0 if P ( X ) is false We say P is primitive recursive. . . PR : Turing-computable functions: total and computable not necessarily total 5 6 A slide from lecture 13: Definition 10.11. Bounded Minimalization For an ( n + 1)-place predicate P , the bounded minimalization of P is the function m P : N n +1 → N defined by � min { y | 0 ≤ y ≤ k and P ( X, y ) } if this set is not empty 10.2. Quantification, Minimalization, and m P ( X, k ) = k + 1 otherwise µ -Recursive Functions The symbol µ is often used for the minimalization operator, and we sometimes write k µ y [ P ( X, y )] m P ( X, k ) = An important special case is that in which P ( X, y ) is ( f ( X, y ) = 0), for some f : N n +1 → N . In this case m P is written m f and referred to as the bounded minimalization of f . 7 8

  2. A slide from lecture 13: A slide from lecture 13: Example 10.13. The n th Prime Number Theorem 10.12. PrNo (0) = 2 If P is a primitive recursive ( n + 1)-place predicate, PrNo (1) = 3 PrNo (2) = 5 its bounded minimalization m P is a primitive recursive function. Prime ( n ) = ( n ≥ 2) ∧ ¬ (there exists y such that Proof. . . y ≥ 2 ∧ y ≤ n − 1 ∧ Mod ( n, y ) = 0) 9 10 A slide from lecture 12: A slide from lecture 13: Theorem 10.4. Example 10.13. The n th Prime Number Every primitive recursive function is total and computable. Let P ( x, y ) = ( y > x ∧ Prime ( y )) Then PrNo (0) = 2 PrNo ( k + 1) = m P ( PrNo ( k ) , ( PrNo ( k ))! + 1) is primitive recursive, with h ( x 1 , x 2 ) = . . . PR : Turing-computable functions: total and computable not necessarily total 11 12 Unbounded minimalization Total? Unbounded minimalization A possible definition: Total? � (min { y | P ( X, y ) is true } ) + 1 if this set is not empty M ( X ) = 0 otherwise Computable? 13 14 Definition 10.14. Unbounded Minimalization A slide from lecture 13: If P is an ( n + 1)-place predicate, the unbounded minimalization Unbounded quantification of P is the partial function M P : N n → N defined by ( y 2 = x ) Sq ( x, y ) = M P ( X ) = min { y | P ( X, y ) is true } M P ( X ) is undefined at any X ∈ N n for which there is no y satis- H ( x, y ) = T u stopt na precies y stappen voor invoer s x fying P ( X, y ). 15 16

  3. Definition 10.15. µ -Recursive Functions Definition 10.14. Unbounded Minimalization The set M of µ -recursive, or simply recursive , partial functions is defined as follows. If P is an ( n + 1)-place predicate, the unbounded minimalization of P is the partial function M P : N n → N defined by 1. Every initial function is an element of M . M P ( X ) = min { y | P ( X, y ) is true } M P ( X ) is undefined at any X ∈ N n for which there is no y satis- 2. Every function obtained from elements of M by composition fying P ( X, y ). or primitive recursion is an element of M . 3. For every n ≥ 0 and every total function f : N n +1 → N in M , The notation µ y [ P ( X, y )] is also used for M P ( X ). the function M f : N n → N defined by In the special case in which P ( X, y ) = ( f ( X, y ) = 0), we write M P = M f and refer to this function as the unbounded minimal- M f ( X ) = µ y [ f ( X, y ) = 0] ization of f . is an element of M . 17 18 Exercise. Example. a. Give an example of a non-total function f and another func- Let 1 ( x, k ) . tion g , such that the composition of f and g is total. f ( x, k ) = p 2 − C 2 1 ( x, k ) b. Can you also find an example of a non-total function f and M f ( x ) . . . another function g , such that the composition of g and f is total? 19 20 Theorem 10.16. 10.3. G¨ odel Numbering All µ -recursive partial functions are computable. Proof. . . 21 22 Definition 10.17. Example 10.18. The G¨ odel Number of a Sequence of Natural Numbers The Power to Which a Prime is Raised in the Factorization of x For every n ≥ 1 and every finite sequence x 0 , x 1 , . . . , x n − 1 of n natural numbers, the G¨ odel number of the sequence is the Function Exponent : N 2 → N defined as follows: number � the exp. of PrNo ( i ) in x ’s prime fact. if x > 0 gn ( x 0 , x 1 , . . . , x n − 1 ) = 2 x 0 3 x 1 5 x 2 . . . ( PrNo ( n − 1)) x n − 1 Exponent ( i, x ) = 0 if x = 0 where PrNo ( i ) is the i th prime (Example 10.13). 23 24

  4. Theorem 10.19. Suppose that g : N n → N and h : N n +2 → N are primitive recursive Example. functions, and f : N n +1 → N is obtained from g and h by course- of-values recursion; that is Fibonacci  f ( X, 0) = g ( X ) 0 if n = 0   f ( n ) = 1 if n = 1 f ( X, k + 1) = h ( X, k, gn ( f ( X, 0) , . . . , f ( X, k )))  f ( n − 1) + f ( n − 2) if n ≥ 2  Then f is primitive recursive. Proof. . . 25 26

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend