<p>There is a very deep connection between inductive definitions and impredicativity, but my understanding is that in the context of what you are talking about (im)predicativity is not particularly relevant and the test is purely to guarantee monotonicity, so that fixed point theory can be applied, namely, that the principle of induction is well-defined. (I'm willing to be corrected on this point.)</p>

<p>The relationship between impredicativity and inductive definitions is explored in this <a href="http://www.cse.chalmers.se/~coquand/NARA.pdf">talk</a> by Coquand. It goes back to some results from the 50s by G. Takeuti that impredicative definitions can be reduced to inductive definitions. The book</p>

<ul>
<li>Proof Theory of Impredicative Subsystems of Analysis - Monographs and Textbooks in Physical Science 2 by W. Buchholz, K. Schutte</li>
</ul>

<p>gives a good analysis of the topic, if you can get your hands on it. These <a href="http://www.math.tohoku.ac.jp/~y-keita/friday-seminar/friday-seminar/akiyoshi0604.pdf">slides</a> give an overview.</p>

CC BY-SA 3.0
2011-04-13T13:04:38.993Z
2011-04-13T13:04:38.993Z
Dave Clarke
<p>Just to complete the excellent explanation by Neil, impredicativity has a "soft" sense: the definition of sets or collections by using a reference to themselves. In that sense:</p>

<pre><code>Inductive Lam : Set :=
| Var : Nat -&gt; Lam
| App : Lam -&gt; Lam -&gt; Lam
| Abs : (Lam -&gt; Lam) -&gt; Lam
</code></pre>

<p>is an impredicative definition, as it defines an inductive type, Lam using a function space (Lam -> Lam) which refers to the collection itself. In this situation, impredicativity is <em>harmful</em>: it is possible to use Cantor's theorem to prove False. In fact this is the same brand of impredicativity which discounts naive Set Theory as a consistent foundation for mathematics. It is therefore disallowed in Coq. <em>Another</em> form of impredicativity <em>is</em> allowed, as you are aware:</p>

<pre><code>Definition Unit : Prop := forall X:Prop, X -&gt; X
</code></pre>

<p>The definition of Unit as a proposition makes reference to the collection of all Propositions of which it is a member. However, for reasons somewhat obscure to me, this impredicativity is <em>not</em> harmful as it is present in ZFC (in the form of <em>unbounded comprehension</em>) which is not known to be inconsistent.</p>

<p>In conclusion, negative occurences of inductive types in definitions is a form of impredicativity, but not the one usually referred to when speaking of CoC as an <em>impredicative framework</em>.</p>

CC BY-SA 3.0
2014-05-25T09:37:36.103Z
I understand you're saying that ZFC has unbounded comprehension. But that sounds wrong — http://math.stackexchange.com/q/24507/79293.
Chlipala discusses this when discussing `-impredicative-set` in his book: http://adam.chlipala.net/cpdt/html/Universes.html, and mentions some restrictions on elimination, but this is obscure to me as well.
Blaisorblade
CC BY-SA 3.0
2014-05-25T15:38:03.213Z
You shouldn't confuse *unrestricted comprehension* and *unbounded comprehension*. The latter just means you can form subsets of a given set $A$ by taking the extension of *any* formula with one free variable, not just formulae with bounded quantifiers (quantifiers of the form $\forall x\in B$ or $\exists x\in B$). The bounded version is significantly weaker, as things like least upper bounds are hard/impossible to define. See [this](http://en.wikipedia.org/wiki/Axiom_schema_of_predicative_separation) for example.
cody
CC BY-SA 3.0
2014-05-26T15:34:38.183Z
Ah, thanks! I also see how the above impredicativity matches the one in ZFC (though the mapping I'm using is probably too naive). Can you add the link in the answer?
Blaisorblade
CC BY-SA 3.0
2014-05-26T15:38:09.623Z
Unfortunately this seems hard to Google (or I don't know the right keywords). What's worse, both Wikipedia and nLab distinguish between "restricted comprehension" (in ZFC, http://en.wikipedia.org/wiki/Axiom_schema_of_specification) and "restricted/bounded separation" (what you linked to). See
http://ncatlab.org/nlab/show/axiom+of+separation.
But all this terminology looks like a misunderstanding waiting to happen — I usually reason that "separation ~ comprehension", like you and the author http://mathforum.org/kb/message.jspa?messageID=4492130 do, too.
Blaisorblade
CC BY-SA 3.0
2014-05-26T20:26:21.417Z
Maybe the best keywords for these kinds of discussions are "Constructive Set Theory", see e.g. [wikipedia](http://en.wikipedia.org/wiki/Constructive_set_theory), or [this](http://www1.maths.leeds.ac.uk/~rathjen/russelle.pdf) very nice article by Rathjen.
cody
CC BY-SA 3.0
2011-06-04T12:09:53.097Z
2016-02-26T16:23:15.337Z
2016-02-26T16:23:15.337Z
cody
<p>No, in this case, predicativity and monotonicity are not closely related. </p>

<p>The positivity check in Coq/Adga serves to ensure that you are taking the least fixed point of a monotonic thing, roughly.</p>

<p>Here's how to think of inductive types in terms of lattices and monotone operators. Recall that the Knaster-Tarski theorem says that on a complete lattice $L$, every monotone operator $f : L \to L$ has a least fixed point $\mu(f)$. Next, we can think of the types in a type theory as forming a lattice under provability. That is, type $S$ is below $T$ if the truth of $S$ entails that of $T$. Now, what we would like to do is to take a monotone operator $F$ on types, and use Knaster-Tarski to get out an interpretation of the least fixed point of this operator $\mu(F)$.  </p>

<p>However, types in type theory aren't just a lattice: they form a category. That is, given two types $S$ and $T$, there are potentially <em>many</em> ways for $S$ to be below $T$, with one way for each proof $e : S \to T$. So a type operator $F$ also has to do something sensible on these proofs. The appropriate generalization of monotonicity is <em>functoriality</em>. That is, we want $F$ to have an operator on types, and also to have an action on proofs, such that if $e : S \to T$, then $F(e) : F(S) \to F(T)$. </p>

<p>Now, functoriality is preserved by sums and products (ie., if $F$ and $G$ are endofunctors on types, then $F+G$ and $F\times G$ (acting pointwise) are also functors on types (assuming we have sums and products in our algebra of types). However, it is not preserved by the function space, since the exponential bifunctor $F \to G$ is contravariant in its left argument. So when you write an inductive type definition, you are defining a functor to take a least fixed point of. To ensure that it is indeed a functor, you need to rule out occurences of the recursive parameter on the left-hand-side of function spaces --- hence the positivity check.</p>

<p>Impredicativity (in the sense of System F) is generally avoided, because it is a principle that forces you to choose between classical logic and set-theoretic models. You can't interpret types as sets in classical set theory if you have F-style indexing. (See Reynolds' famous "Polymorphism is Not Set-Theoretic".)</p>

<p>Categorically, F-style impredicativity says that the category of types and terms forms a small complete category (that is, homs and objects are both sets, and limits of all small diagrams exist). Classically this forces a category to be a poset.   Many constructivists are constructive because they want their theorems to hold in <em>more</em> systems than just classical logic, and so they don't want to prove anything that would be classically false. Hence they are leery of impredicative polymorphism.</p>

<p>However, polymorphism lets you say many conditions that are classically "large" internally to your type theory -- and positivity is one of them! A type operator $F$ is functorial, if you can produce a polymorphic term:</p>

<p>$$
\mathsf{Fmap} : \forall \alpha, \beta.\; (\alpha \to \beta) \to (F(\alpha) \to F(\beta))
$$</p>

<p>See how this corresponds to functoriality? IMO, this would be a very nice option to have in Coq, since it would let you do generic programming much more easily. The syntactic nature of the positivity check is a big hindrance to generic programming, and I would be happy to trade the possibility of classical axioms for more flexible functional programs.  </p>

<p>EDIT: The question you are asking about the difference between Prop and Set arises from the fact that the Coq developers want to <em>permit</em> you think about Coq theorems in naive set-theoretic terms if you want, without <em>forcing</em> you to do so. Technically, they split Prop and Set, and then prohibit sets from depending on the computational content of Prop. </p>

<p>So you can interpret Prop as truth values in ZFC, which are the booleans true and false. In this world, all proofs of propositions are equal, and so obviously you should not be able to branch on the proof of a proposition. So the prohibition on sets depending on the computational content of proofs of Prop is totally sensible. Furthermore, the 2-element boolean lattice is obviously a complete lattice, so it should support impredicative indexing, since arbitrary set-valued meets exist. The predicativity restriction on Sets arises from the fact (mentioned above) that F-style indexing is degenerate in classical set-theoretic models.</p>

<p>Coq has other models (it's constructive logic!) but the point is that off the shelf it will never prove anything that a classical mathematician would be puzzled by.</p>

CC BY-SA 3.0
2011-04-13T14:22:27.357Z
Thanks for your response, Neel. Your definition of "inductive definition" seems to correspond more to the "initial $F$-algebra" approach: instead of monotonic functions (which say nothing of proofs and computational content), we concern ourselves with (the more general notion of) functors. So rather than checking for monotonicity, Coq is really checking for functoriality. However, if predicativity is not in question, why does Coq distinguish between the positive-occurrence-check for defined objects in $\mathrm{Prop}$ and those in $\mathrm{Set}$ or $\mathrm{Type}$?
Scott Kilpatrick
CC BY-SA 3.0
2011-04-13T14:56:42.410Z
I don't understand your question: Coq hates `Inductive Blah : Prop := Foo : (Blah -> Blah) -> Blah` same as anything else?
Neel Krishnaswami
CC BY-SA 3.0
2011-04-13T15:04:33.873Z
Ah, perhaps I am mistaking the positivity check for another check related to impredicativity. Consider `Inductive prop : Prop := prop_intro : Prop -> prop.` vs. `Inductive set : Set := set_intro: Set -> set.`. Why the distinction if predicativity is of no concern to inductive definition?
Scott Kilpatrick
CC BY-SA 4.0
2019-03-31T17:14:16.597Z
@ScottKilpatrick: that’s indeed a different check, and about (im)predicativity. Impredicative strong Sigma-types allow encoding Girard’s paradox, so a datatype storing a member of some universe, say `Type@{i}`, must live in a bigger universe, at least `Type@{i+1}`.
Blaisorblade
CC BY-SA 3.0
2011-04-13T13:19:27.430Z
2011-04-13T18:41:28.277Z
2011-04-13T18:41:28.277Z
Neel Krishnaswami
<p>We often want to define an object $A \in U$ according to some inference rules. Those rules denote a generating function $F$ which, when it is monotonic, yields a least fixed point $\mu F$. We take $A := \mu F$ to be the "inductive definition" of $A$. Moreover, monotonicity of $F$ allows us to reason with the "principle of induction" to determine when a set contains $A$ (i.e. when a property universally holds on $A$).</p>

<p>In Coq this corresponds to writing an $\mathtt{Inductive}$ definition of $A$ with explicit introduction terms. While this definition denotes a particular function $F$, that function is not necessarily monotonic. Coq therefore employs some syntactic checks to guarantee the "well-formedness" of the definition. To some approximation, it rejects occurrences of $A$ in negative positions in the types of the introduction terms.</p>

<p>(If my understanding up to this point is flawed, please correct me!)</p>

<p>First, some questions in the context of Coq:</p>

<p>1) Does the syntactic check in Coq merely serve to ensure that the definition of $A$ is <em>predicative</em>? (If so, is impredicativity the only way in which the definition would be ill-defined?) Or is it checking for monotonicity? (Correspondingly, is non-monotonicity what might kill it?)</p>

<p>2) Does such a negative occurrence of $A$ necessarily imply that $A$'s definition is impredicative/non-monotonic? Or is Coq simply unable to verify that it's well-defined in that case?</p>

<p>And more generally:</p>

<p>3) What is the relation between predicativity of an inductive definition and monotonicity of that definition's generating function? Are they two sides of the same coin? Are they unrelated? Informally, which one matters more?</p>

<lo.logic><pl.programming-languages><type-theory><proof-assistants><coq>
What is the role of predicativity in inductive definitions in type theory?
Scott Kilpatrick
# What is the role of predicativity in inductive definitions in type theory?

(Asked by: username_0 on 2011-04-13)

We often want to define an object $A \in U$ according to some inference rules. Those rules denote a generating function $F$ which, when it is monotonic, yields a least fixed point $\mu F$. We take $A := \mu F$ to be the "inductive definition" of $A$. Moreover, monotonicity of $F$ allows us to reason with the "principle of induction" to determine when a set contains $A$ (i.e. when a property universally holds on $A$).

In Coq this corresponds to writing an $\mathtt{Inductive}$ definition of $A$ with explicit introduction terms. While this definition denotes a particular function $F$, that function is not necessarily monotonic. Coq therefore employs some syntactic checks to guarantee the "well-formedness" of the definition. To some approximation, it rejects occurrences of $A$ in negative positions in the types of the introduction terms.

(If my understanding up to this point is flawed, please correct me!)

First, some questions in the context of Coq:

1) Does the syntactic check in Coq merely serve to ensure that the definition of $A$ is *predicative*? (If so, is impredicativity the only way in which the definition would be ill-defined?) Or is it checking for monotonicity? (Correspondingly, is non-monotonicity what might kill it?)

2) Does such a negative occurrence of $A$ necessarily imply that $A$'s definition is impredicative/non-monotonic? Or is Coq simply unable to verify that it's well-defined in that case?

And more generally:

3) What is the relation between predicativity of an inductive definition and monotonicity of that definition's generating function? Are they two sides of the same coin? Are they unrelated? Informally, which one matters more?

**Tags:** lo.logic, pl.programming-languages, type-theory, proof-assistants, coq

---

## 3 answers

### Answer by username_4 on 2011-04-13. Score: 16 | Accepted answer

No, in this case, predicativity and monotonicity are not closely related.

The positivity check in Coq/Adga serves to ensure that you are taking the least fixed point of a monotonic thing, roughly.

Here's how to think of inductive types in terms of lattices and monotone operators. Recall that the Knaster-Tarski theorem says that on a complete lattice $L$, every monotone operator $f : L \to L$ has a least fixed point $\mu(f)$. Next, we can think of the types in a type theory as forming a lattice under provability. That is, type $S$ is below $T$ if the truth of $S$ entails that of $T$. Now, what we would like to do is to take a monotone operator $F$ on types, and use Knaster-Tarski to get out an interpretation of the least fixed point of this operator $\mu(F)$.

However, types in type theory aren't just a lattice: they form a category. That is, given two types $S$ and $T$, there are potentially *many* ways for $S$ to be below $T$, with one way for each proof $e : S \to T$. So a type operator $F$ also has to do something sensible on these proofs. The appropriate generalization of monotonicity is *functoriality*. That is, we want $F$ to have an operator on types, and also to have an action on proofs, such that if $e : S \to T$, then $F(e) : F(S) \to F(T)$.

Now, functoriality is preserved by sums and products (ie., if $F$ and $G$ are endofunctors on types, then $F+G$ and $F\times G$ (acting pointwise) are also functors on types (assuming we have sums and products in our algebra of types). However, it is not preserved by the function space, since the exponential bifunctor $F \to G$ is contravariant in its left argument. So when you write an inductive type definition, you are defining a functor to take a least fixed point of. To ensure that it is indeed a functor, you need to rule out occurences of the recursive parameter on the left-hand-side of function spaces --- hence the positivity check.

Impredicativity (in the sense of System F) is generally avoided, because it is a principle that forces you to choose between classical logic and set-theoretic models. You can't interpret types as sets in classical set theory if you have F-style indexing. (See Reynolds' famous "Polymorphism is Not Set-Theoretic".)

Categorically, F-style impredicativity says that the category of types and terms forms a small complete category (that is, homs and objects are both sets, and limits of all small diagrams exist). Classically this forces a category to be a poset. Many constructivists are constructive because they want their theorems to hold in *more* systems than just classical logic, and so they don't want to prove anything that would be classically false. Hence they are leery of impredicative polymorphism.

However, polymorphism lets you say many conditions that are classically "large" internally to your type theory -- and positivity is one of them! A type operator $F$ is functorial, if you can produce a polymorphic term:

$$
\mathsf{Fmap} : \forall \alpha, \beta.\; (\alpha \to \beta) \to (F(\alpha) \to F(\beta))
$$

See how this corresponds to functoriality? IMO, this would be a very nice option to have in Coq, since it would let you do generic programming much more easily. The syntactic nature of the positivity check is a big hindrance to generic programming, and I would be happy to trade the possibility of classical axioms for more flexible functional programs.

EDIT: The question you are asking about the difference between Prop and Set arises from the fact that the Coq developers want to *permit* you think about Coq theorems in naive set-theoretic terms if you want, without *forcing* you to do so. Technically, they split Prop and Set, and then prohibit sets from depending on the computational content of Prop.

So you can interpret Prop as truth values in ZFC, which are the booleans true and false. In this world, all proofs of propositions are equal, and so obviously you should not be able to branch on the proof of a proposition. So the prohibition on sets depending on the computational content of proofs of Prop is totally sensible. Furthermore, the 2-element boolean lattice is obviously a complete lattice, so it should support impredicative indexing, since arbitrary set-valued meets exist. The predicativity restriction on Sets arises from the fact (mentioned above) that F-style indexing is degenerate in classical set-theoretic models.

Coq has other models (it's constructive logic!) but the point is that off the shelf it will never prove anything that a classical mathematician would be puzzled by.

> **Comments:**
> **username_0**: Thanks for your response, Neel. Your definition of "inductive definition" seems to correspond more to the "initial $F$-algebra" approach: instead of monotonic functions (which say nothing of proofs and computational content), we concern ourselves with (the more general notion of) functors. So rather than checking for monotonicity, Coq is really checking for functoriality. However, if predicativity is not in question, why does Coq distinguish between the positive-occurrence-check for defined objects in $\mathrm{Prop}$ and those in $\mathrm{Set}$ or $\mathrm{Type}$?  
> **username_4**: I don't understand your question: Coq hates `Inductive Blah : Prop := Foo : (Blah -> Blah) -> Blah` same as anything else?  
> **username_0**: Ah, perhaps I am mistaking the positivity check for another check related to impredicativity. Consider `Inductive prop : Prop := prop_intro : Prop -> prop.` vs. `Inductive set : Set := set_intro: Set -> set.`. Why the distinction if predicativity is of no concern to inductive definition?  
> **username_3**: @ScottKilpatrick: that’s indeed a different check, and about (im)predicativity. Impredicative strong Sigma-types allow encoding Girard’s paradox, so a datatype storing a member of some universe, say `Type@{i}`, must live in a bigger universe, at least `Type@{i+1}`.  

---

### Answer by username_1 on 2011-04-13. Score: 6

There is a very deep connection between inductive definitions and impredicativity, but my understanding is that in the context of what you are talking about (im)predicativity is not particularly relevant and the test is purely to guarantee monotonicity, so that fixed point theory can be applied, namely, that the principle of induction is well-defined. (I'm willing to be corrected on this point.)

The relationship between impredicativity and inductive definitions is explored in this [talk](http://www.cse.chalmers.se/~coquand/NARA.pdf) by Coquand. It goes back to some results from the 50s by G. Takeuti that impredicative definitions can be reduced to inductive definitions. The book

* Proof Theory of Impredicative Subsystems of Analysis - Monographs and Textbooks in Physical Science 2 by W. Buchholz, K. Schutte

gives a good analysis of the topic, if you can get your hands on it. These [slides](http://www.math.tohoku.ac.jp/~y-keita/friday-seminar/friday-seminar/akiyoshi0604.pdf) give an overview.


---

### Answer by username_2 on 2011-06-04. Score: 4

Just to complete the excellent explanation by Neil, impredicativity has a "soft" sense: the definition of sets or collections by using a reference to themselves. In that sense:
Inductive Lam : Set :=
| Var : Nat -> Lam
| App : Lam -> Lam -> Lam
| Abs : (Lam -> Lam) -> Lam

is an impredicative definition, as it defines an inductive type, Lam using a function space (Lam -> Lam) which refers to the collection itself. In this situation, impredicativity is harmful: it is possible to use Cantor's theorem to prove False. In fact this is the same brand of impredicativity which discounts naive Set Theory as a consistent foundation for mathematics. It is therefore disallowed in Coq. Another form of impredicativity is allowed, as you are aware:
Definition Unit : Prop := forall X:Prop, X -> X

The definition of Unit as a proposition makes reference to the collection of all Propositions of which it is a member. However, for reasons somewhat obscure to me, this impredicativity is not harmful as it is present in ZFC (in the form of unbounded comprehension) which is not known to be inconsistent.
In conclusion, negative occurences of inductive types in definitions is a form of impredicativity, but not the one usually referred to when speaking of CoC as an impredicative framework.

> **Comments:**
> **username_3**: I understand you're saying that ZFC has unbounded comprehension. But that sounds wrong — http://math.stackexchange.com/q/24507/79293. Chlipala discusses this when discussing `-impredicative-set` in his book: http://adam.chlipala.net/cpdt/html/Universes.html, and mentions some restrictions on elimination, but this is obscure to me as well.  
> **username_2**: You shouldn't confuse *unrestricted comprehension* and *unbounded comprehension*. The latter just means you can form subsets of a given set $A$ by taking the extension of *any* formula with one free variable, not just formulae with bounded quantifiers (quantifiers of the form $\forall x\in B$ or $\exists x\in B$). The bounded version is significantly weaker, as things like least upper bounds are hard/impossible to define. See [this](http://en.wikipedia.org/wiki/Axiom_schema_of_predicative_separation) for example.  
> **username_3**: Ah, thanks! I also see how the above impredicativity matches the one in ZFC (though the mapping I'm using is probably too naive). Can you add the link in the answer?  
> **username_3**: Unfortunately this seems hard to Google (or I don't know the right keywords). What's worse, both Wikipedia and nLab distinguish between "restricted comprehension" (in ZFC, http://en.wikipedia.org/wiki/Axiom_schema_of_specification) and "restricted/bounded separation" (what you linked to). See http://ncatlab.org/nlab/show/axiom+of+separation. But all this terminology looks like a misunderstanding waiting to happen — I usually reason that "separation ~ comprehension", like you and the author http://mathforum.org/kb/message.jspa?messageID=4492130 do, too.  
> **username_2**: Maybe the best keywords for these kinds of discussions are "Constructive Set Theory", see e.g. [wikipedia](http://en.wikipedia.org/wiki/Constructive_set_theory), or [this](http://www1.maths.leeds.ac.uk/~rathjen/russelle.pdf) very nice article by Rathjen.  

---

