Showing changes from revision #1 to #2:
Added | Removed | Changed
To understand recursion, one must first understand recursion.
— An old joke
Joke as it may be, the quote above is very nearly the truth. The missing ingredient are conditions to guarantee that the process terminates; formally, what we need are base cases and a well-founded relation on the domain on which we are recursing.
Frequently the domain of interest is the natural numbers, or more generally an inductive structure. In the former case there is a rich theory regarding the functions which can or cannot be recursively defined: this is computability theory and has deep connections with the logic of Peano arithmetic.
Example. In the theory of Peano arithmetic, we define recursively in terms of the successor operation as follows:
The definition above is taken as axiomatic in Peano arithmetic. More generally, given a (parametrizable) natural numbers object , its universal property guarantees that there is a unique (!) map with the above properties.
Theorem. Let , , and be sets, and suppose is a well-founded relation on . Let be a given function. Then, there is a unique function satisfying
Let , , and be sets, and suppose is a well-founded relation on . Let be a given function. Then, there is a unique function satisfying
for all in , where
By the principle of well-founded induction. (Details to be added.)
for all in , where
Proof. By the principle of well-founded induction. (Details to be added.)
Theorem. Let be a (parametrizable) natural numbers object in a category with finite products, with zero and successor . For any morphisms and , there is a unique morphism such that
Let be a (parametrizable) natural numbers object in a category with finite products, with zero and successor . For any morphisms and , there is a unique morphism such that
and
where is the first projection and is the second projection.
Recall that the universal property for states that for data , , there is a unique morphism such that and . We take , , and , where , , and are the obvious projections. The we seek is then obtained as , where is the second projection.
and
where is the first projection and is the second projection.
Proof. Recall that the universal property for states that for data , , there is a unique morphism such that and . We take , , and , where , , and are the obvious projections. The we seek is then obtained as , where is the second projection.
Dually, there is a notion of corecursion on a coinductive structure.
Revision on August 26, 2011 at 15:10:55 by Urs Schreiber See the history of this page for a list of all contributions to it.