Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Sort hierarchy

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Sort hierarchy


chronological Thread 
  • From: Bas Spitters <spitters AT cs.ru.nl>
  • To: Coq Club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] Sort hierarchy
  • Date: Thu, 21 Jan 2010 10:00:27 +0100
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=svcKSHGHDCSonjZ+WQ88kfBzUgwwmFt0jAzJS2jeTlqFfDh14O7z2ihP8+hpT3E0Si 4miZTi6FbB5cEMICcK0hh8LjkMR6239aIE4vQYrYzYXuVgInscwrc7WK+WYdXvWjXW6F HG/TMptnUGpdXAUNaod/zyIEG47UG62bEn7hc=

Dear Hugo,

This seems like a sensible idea. I do not see any problems with it (yet).
Thanks for the explanation!

Recently, while developing some simple category theory, we ran into a universe
inconsistency while working with the category of all categories.
(Perhaps we should have been using higher categories, but alas).
It seems that this could have been avoided if Definitions could be
universe polymorphic.
Are there any plans to change this?
Do you want me to try and make a minimal test case?

Best,

Bas


On Wed, Jan 20, 2010 at 7:08 PM, Hugo Herbelin 
<Hugo.Herbelin AT inria.fr>
 wrote:
> Hi Bas,
>
>> I recently learned that the Coq sort hierarchy has changed. Prop is
>> now a subsort of Set.
>>
>> Could anyone tell me about the reasons for this change and its
>> theoretical motivations?
>
> The practical motivation of this change is to have that the sorts
> assigned to sort-polymorphic inductive types are linearly ordered,
> and, in particular that whenever a sort-polymorphic type is set at
> some level Prop, predicative Set or Type(i), then it is also in all
> levels above.
>
> Before we had
>
>    Prop : Type0 : Type1 : ...
>    Set  : Type0 : Type1 : ...
>
> with the inclusions
>
>    Prop < Type0 < Type1 < ...
>    Set  < Type0 < Type1 < ...
>
> This meant that a sort-polymorphic inductive type on which no
> level constraints applied like
>
>  Inductive unit := tt
>
> could not be seen as a Set if placed in Prop as the absence of
> constraints tells it should be.
>
> With the new hierarchy, we have
>
>    Prop : Type0 : Type1 : ...
>    Set  : Type0 : Type1 : ...
>    Prop < Set   < Type1 < Type2 < ...
>
> which in fact is the same as
>
>    Prop            : Type0 : Type1 : ...
>           Type(-1) : Type0 : Type1 : ...
>    Prop < Type(-1) < Type0 < Type1 < ...
>
> if we interpret predicative Set as Type(-1), which, if we shift the
> indices used to number the levels, is the same as
>
>    Prop         : Type1 : Type2 : ...
>           Type0 : Type1 : Type2 : ...
>    Prop < Type0 < Type1 < Type2 < ...
>
> which differs only from the original hierarchy by not using Set and by
> enforcing the type of Prop to be Type1 instead of Type0, what at the
> end corresponds to a subset of the former system.
>
> With the new hierarchy, unit, while still put by default at level
> Prop, can now freely be used as a Set, what is more convenient and in
> my opinion more natural.
>
> One may argue that it could be as simpler to interpret predicative Set
> as Type0 (instead of a virtual Type(-1)) and to keep Prop of type
> Type0. My point is that it is in practise not more complicated to
> implement Prop of type Type1 than of Type0, and that this allows to
> keep a sort guaranteed not to contain Prop.
>
> I don't see any disavantage to this approach up to now, but comments
> are welcome.
>
> Hugo
>
> PS: I followed the convention of the Reference Manual of Coq
> (chapter 4) which numbers Type levels from 0 (what leads to introduce
> a negative level to interpret Set as a distinct Type). By the way, I
> just remarked that paragraph "Convertibility" in Section 4.3 of the
> reference manual is not up to date (though paragraph
> "Sort-polymorphism of inductive families" of Section 4.5.3 is).
>
> PS2: An alternative could have been to introduce a new base sort, say
> Singleton, to type the inductive types low enough to be put in Prop,
> with the associated subtyping Singleton < pSet and Singleton < Prop. My
> feeling was however that it would have made things more complicated
> than just having Prop < pSet and I renounced to it.
>




Archive powered by MhonArc 2.6.16.

Top of Page