Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are inductive predicates?

How would you explain inductive predicates? What are they used for? What's the theory behind them? Are they only present in dependent type systems, or in other systems as well? Are they related to GADT's in some way? Why are they true by default in Coq?

This is an example from Coq:

Inductive even : nat -> Prop :=
| even0 : even 0
| evens : forall p:nat, even p -> even (S (S P))

How would you use this definition? Is it a datatype or a proposition?

like image 866
Olle Härstedt Avatar asked Apr 11 '14 19:04

Olle Härstedt


People also ask

What is a predicate in induction?

At a nuts-and-bolts level, induction is a tool for proving that some predicate P(n) holds for any natural number n. When writing an inductive proof, you'll want to choose P(n) so that you can prove your overall result by showing that P(n) is true for every natural number n.

What is induction property?

A proof by induction consists of two cases. The first, the base case, proves the statement for n = 0 without assuming any knowledge of other cases. The second case, the induction step, proves that if the statement holds for any given case n = k, then it must also hold for the next case n = k + 1.


1 Answers

I think we call inductive predicates objects that are defined inductively and sorted in Prop.

They are used for defining properties inductively (duh). The theory behind can probably be found in the literature for inductive constructions. Search papers about CIC (the Calculus of Inductive Constructions) for instance.

They are somewhat related to GADTs, though with dependent types they can express more things. If I am not mistaken, with GADTs each constructor lives in one particular family, whereas the addition of dependent types allows constructors to inhabit different families based on their arguments.

I do not know what you mean by "true by default in Coq".

even as you define it is an inductive datatype. It is not a proposition yet, as the type nat -> Prop indicates. A proposition would be even 0 or even 1. It can be inhabited (provable) as in even 0, or not as in even 1.

like image 85
Ptival Avatar answered Sep 17 '22 23:09

Ptival