TITLE: How to apply the recursion theorem in practice?
QUESTION [16 upvotes]: The recursion theorem

In set theory, this is a theorem guaranteeing that recursively defined functions exist. Given a set $X$, $a \in X$ and a function $f \colon X \to X$, the theorem states that there is a unique function  $F:\mathbb{N} \to X$  (where $\mathbb{N}$ denotes the set of natural numbers including zero) such that
$$F(0) = a$$
$$F(n + 1) = f(F(n))$$
for any natural number $n$.

How do you apply this in practice? How, for example, do you apply it to prove the existence of the factorial function?

REPLY [2 votes]: Follow up: With the aid of my DC Proof program, I as able to formally prove that given a set X and element a in X and a function g: N x X --> X, there exists a function f: N --> X such that

f(1)=a
For all k in N, f(k+1) = g(k+1, f(k))

where N is set of natural numbers {1, 2, 3... }
Example: For the factorial function, we have X=N, a=1 and g(x,y) = x*y (multiplication on N).

Factorial(1)=1
For all k in N, Factorial(k+1) = (k+1) * Factorial(k)

I was able to construct f from the sets N and X using only Cartesian product, power set and subset rules.
See HTML version at http://www.dcproof.com/recursive.html  (669 lines)