Recursion and Inductive Constructions
Recursion is the dual of induction: while induction proves properties of all natural numbers, recursion defines functions and sequences on natural numbers. Both stem from the well-founded structure of .
A function is defined by primitive recursion from functions and if:
The value at depends on the previous value at , building up the function recursively.
The factorial function can be defined by primitive recursion:
Here (constant function) and . By the recursion theorem, this uniquely determines a function with .
Computing: , , , etc.
A more general form allows the value at to depend on all previous values:
This is equivalent to primitive recursion but sometimes more convenient. It corresponds to strong induction.
The Ackermann function demonstrates that not all computable functions are primitive recursive:
This grows extremely rapidly: has over 19,000 digits. The Ackermann function is computable (by double recursion) but not primitive recursive, showing that recursion can be more powerful than simple iteration.
Every natural number has a unique representation. Specifically:
- Either , or
- for a unique
This is immediate from the construction: , and we can recover as the largest element of .
Unique readability is crucial for induction and recursion. It ensures that when we define a function by cases and , these cases are mutually exclusive and exhaustive, so is well-defined.
More abstractly, we can define functions by structural recursion on any well-founded structure. For natural numbers, this means:
Given and , there exists a unique with:
This principle extends to trees, lists, and other inductive data structures.
Every natural number has a unique binary representation. We can define a function (finite binary strings) recursively:
For instance: .
Using primitive recursion, we can define addition, multiplication, and exponentiation on , and prove all their standard properties by induction:
- Associativity:
- Commutativity:
- Distributivity:
- Identity: and
- No zero divisors:
These are proved by induction on one variable while holding others fixed.
The division algorithm can be proved by strong induction: for any with , there exist unique with and .
Proof sketch: By strong induction on . If , take . Otherwise , so by induction hypothesis applied to , we have with . Then with .
We can construct the integers from using equivalence classes. Define an equivalence relation on by:
The equivalence class represents the integer . The set with operations:
forms an integral domain extending .
This construction shows how all of arithmetic—and indeed all of mathematics—can be built from the empty set through the axioms of ZFC. The natural numbers come from the axiom of infinity, and more complex number systems (integers, rationals, reals, complex numbers) are constructed via quotients, completions, and other set-theoretic operations.
Recursion and induction are two sides of the same coin, both exploiting the well-founded nature of . Together, they provide the foundation for all discrete mathematics and computer science.