World Library  
Flag as Inappropriate
Email this Article

Inductive type

Article Id: WHEBN0022778065
Reproduction Date:

Title: Inductive type  
Author: World Heritage Encyclopedia
Language: English
Subject: Type theory, Process Environment Block, Kind (type theory), Rational data type, MPIR (mathematics software)
Publisher: World Heritage Encyclopedia

Inductive type

In type theory, a system has inductive types if it has facilities for creating a new type along with constants and functions that create terms of that type. The feature serves a role similar to data structures in a programming language and allows a type theory to add concepts like numbers, relations, and trees. As the name suggests, inductive types can be self-referential, but usually only in a way that permits structural recursion.

The standard example is encoding the natural numbers using Peano's encoding.

Inductive nat : Type :=
  | 0 : nat
  | S : nat -> nat.

Here, a natural number is created either from the constant "0" or by applying the function "S" to another natural number. "S" is the successor function which represents adding 1 to a number. Thus, "0" is zero, "S 0" is one, "S (S 0)" is two, "S (S (S 0))" is three, and so on.

Since their introduction, inductive types have been extended to encode more and more structures, while still being predicative and supporting structural recursion.


Inductive types usually come with a function to prove properties about them. Thus, "nat" may come with:

nat_elim : (forall P : nat -> Prop, (P 0) -> (forall n, P n -> P (S n)) -> (forall n, P n)).

This is the expected function for structural recursion for the type "nat".


W types

W Types were well-founded types in intuitionistic type theory (ITT).

Mutually inductive definitions

This technique allows some definitions of multiple types that depend on each other.

Inductive even : nat -> Prop :=
  | zero_is_even 0 : even
  | S_of_odd_is_even : (forall n:nat, odd n -> even (S n))
 Inductive odd : nat -> Prop :=
   | S_of_even_is_odd : (forall n:nat, even n -> odd (S n))


Induction-recursion started as a study into the limits of ITT. Once found, the limits were turned into rules that allowed defining new inductive types. These types could depend upon a function and the function on the type, as long as both were defined simultaneously.

Universe types can be defined using induction-recursion.


Induction-induction allows definition of a type and a family of types at the same time. So, a type A and a family of types B : A \to Type.

Higher inductive types

This is a current research area in Homotopy Type Theory (HoTT). HoTT differs from ITT by its identity type (equality). Higher inductive types not only define a new type with constants and functions that create the type, but also new instances of the identity type that relate them.

A simple example is the circle type, which is defined with two constructors, a basepoint;

base : circle

and a loop;

loop : base = base.

The existence of a new constructor for the identity type makes circle a higher inductive type.

See also

  • Coinduction permits (effectively) infinite structures in type theory.

External links

  • Induction-Recursion Slides
  • Induction-Induction Slides
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.