In intuitionistic type theory (ITT), a discipline within mathematical logic, induction-recursion is a feature for simultaneously declaring a type and function on that type. It allows the creation of larger types than inductive types, such as universes. The types created still remain predicative inside ITT.
An inductive definition is given by rules for generating elements of a type. One can then define functions from that type by induction on the way the elements of the type are generated. Induction-recursion generalizes this situation since one can simultaneously define the type and the function, because the rules for generating elements of the type are allowed to refer to the function.[1]
Induction-recursion can be used to define large types including various universe constructions. It increases the proof-theoretic strength of type theory substantially. Nevertheless, inductive-recursive recursive definitions are still considered predicative.
Induction-Recursion came out of investigations to the rules of Martin-Löf's intuitionistic type theory. The type theory has a number of "type formers" and four kinds of rules for each one. Martin-Löf had hinted that the rules for each type former followed a pattern, which preserved the properties of the type theory (e.g., strong normalization, predicativity). Researchers started looking for the most general description of the pattern, since that would tell what kinds of type formers could be added (or not added!) to extend the type theory.
The "universe" type former was the most interesting, because when the rules were written "à la Tarski", they simultaneously defined the "universe type" and a function that operated on it. This eventually lead Dybjer to Induction-Recursion.
Dybjer's initial papers called Induction-Recursion a "schema" for rules. It stated what type formers could be added to the type theory. Later, he and Setzer would write a new type former with rules that allowed new Induction-Recursion definitions to be made inside the type theory.[2] This was added to the Half proof assistant (a variant of Alf).
Before covering Inductive-Recursive types, the simpler case is Inductive Types. Constructors for Inductive types can be self-referential, but in a limited way. The constructor's parameters must be "positive":
With Inductive types, a parameter's type can depend on earlier parameters, but they cannot refer to ones of the type being defined. Inductive-Recursive types go further and parameter's types can refer to earlier parameters that use the type being defined. These must be "half-positive":
So, if
D
f
a:A
d:D
g:A\toType
h:A\toD
i:A\toB\toD
j:g a
D
This is half-positive:
k:(f d)\toD
d
D
f
These are not positive nor half-positive:
k:D\toA
D
l:(A\toD)\toA
D
A
m:z d
d
D
f
A simple common example is the Universe à la Tarski type former. It creates a type
U
T
U
U
T
U
The type
U
constructor\Pi(u:U)(u':T(u)\toU):U
That is, it takes an element
u
U
u'
x:T(u)
u'(x)
x
:U
U
The reduction (or computation rule) says that
T(constructor\Pi(u,u'))
\prodx:T(u)T(u'(x))
After reduction, the function
T
T
T
Induction-Recursion is implemented in Agda and Idris.[3]