Content deleted Content added
m Cic moved page Induction-recursion (type theory) to Induction-recursion: No collision |
m Minor formatting fixes |
||
(23 intermediate revisions by 13 users not shown) | |||
Line 1:
{{Short description|Concept in mathematical logic}}
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
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.<ref name=Dybjer>{{cite journal|last=Dybjer|first=Peter|title=A general formulation of simultaneous inductive-recursive definitions in type theory|journal=Journal of Symbolic Logic|volume=65|issue=2|date=June 2000|pages=525–549|url=http://www.cse.chalmers.se/~peterd/papers/Inductive_Recursive.pdf|doi=10.2307/2586554|jstor=2586554|citeseerx=10.1.1.6.4575|s2cid=18271311 }}</ref>
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-
==Background==
Induction-
The "universe" type former was the most interesting, because when the rules were written "
Dybjer's initial papers called
==The idea==
Before covering
* not refer to the type being defined
* be exactly the type being defined, or
* be a function that returns the type being defined.
With
* be a function depending on an earlier parameter '''if''' that parameter is wrapped in the function being defined.
Line 26 ⟶ 27:
* <math>a:A</math>
* <math>d:D</math>
* <math>g:A \to \mathsf{Type}</math>
* <math>h:A \to D</math>
* <math>i:A \to B \to D</math>
Line 41 ⟶ 42:
== Universe example ==
A simple common example is the
The type <math>U</math> has a constructor (or introduction rule) for each type former in the type theory.
<math>
That is, it takes an element <math>u</math> of type <math>U</math> that will map to the type of the parameter, and
The reduction (or computation rule) says that <math>T(\mathsf{constructor}_\Pi(u, u'))</math> reduces to <math>\prod_{x:T(u)} T(u'(x))</math>.
After reduction, the function <math>T</math> is operating on a smaller part of the input.
▲After reduction, the function <math>T</math> is operating on a smaller part of the input. If that holds when <math>T</math> is applied to any constructor, then <math>T</math> will always terminate. Without going into the details, Induction-Recursion states what kinds of definitions (or rules) can be added to the theory such that the function calls will always terminate.
==Usage==
Induction-recursion is implemented in [[Agda (programming language)|Agda]] and [[Idris (programming language)|Idris]].<ref>{{Cite book|last1=Bove|first1=Ana|last2=Dybjer|first2=Peter|last3=Norell|first3=Ulf|title=Theorem Proving in Higher Order Logics |chapter=A Brief Overview of Agda – A Functional Language with Dependent Types |date=2009|editor-last=Berghofer|editor-first=Stefan|editor2-last=Nipkow|editor2-first=Tobias|editor3-last=Urban|editor3-first=Christian|editor4-last=Wenzel|editor4-first=Makarius|chapter-url=https://link.springer.com/chapter/10.1007%2F978-3-642-03359-9_6|series=Lecture Notes in Computer Science|volume=5674 |language=en|___location=Berlin, Heidelberg|publisher=Springer|pages=73–78|doi=10.1007/978-3-642-03359-9_6|isbn=978-3-642-03359-9}}</ref>
==See also==
* [[Induction-induction]] - further work that defines a type and a family
==References==
|