Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Question about Coq universes

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Question about Coq universes


Chronological Thread 
  • From: Gaëtan Gilbert <gaetan.gilbert AT skyskimmer.net>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Question about Coq universes
  • Date: Wed, 22 Apr 2020 18:05:24 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=gaetan.gilbert AT skyskimmer.net; spf=Pass smtp.mailfrom=gaetan.gilbert AT skyskimmer.net; spf=None smtp.helo=postmaster AT relay7-d.mail.gandi.net
  • Ironport-phdr: 9a23:aAx2rB+cSx6SZf9uRHKM819IXTAuvvDOBiVQ1KB30OscTK2v8tzYMVDF4r011RmVBNidt60P27WempujcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47xaFLIv3K98yMZFAnhOgppPOT1HZPZg9iq2+yo9JDffgVFiCCybL5wIxm7rgfcvdQKjIV/Lao81gHHqWZSdeRMwmNoK1OTnxLi6cq14ZVu7Sdete8/+sBZSan1cLg2QrJeDDQ9LmA6/9brugXZTQuO/XQTTGMbmQdVDgff7RH6WpDxsjbmtud4xSKXM9H6QawyVD+/6apgVR3mhzodNzMh7W/ZlMJwgqJYrhyvqRNwzIzbb52aOvdlYqPQfskXSXZdUstfVSFMBJ63YYsVD+oGOOZVt4jzqEESqhuiHwasAvvgxD5Jhn/yxqI1zf4hER3b1wEnENIBqmrbrMnvO6cUS+y1w6jIzTHYYPxIwzf99JPFcgsiofCMRrJwcsvRyUwqFwzblFWcs4rlMC2J1ukUtWWQ8uRuVeWqi2E9qgFxpCCixtoqionImIIZ00vE9SBiz4ovK924Ukh2asOnHptIryyWKZZ6T8E4T2xqpCo20KAKtJ21cSQQ1pgr2wLTZ+SZf4SV7B/vTvudLDdmiH5/Zb6yhgu+/VK9xuD8UMS/zUxEoTBfktbWs3AAzxzT5daDSvt65kqhwyiA1wTJ5eBEI004jLfUJ4QkwrEql5oTtV7PHiDsl0XwkaCWd18o+u625OT7ernmp5mcOJFoigzmLKgih86yDf46PwQSRWSX5Oex2bP58UHnXLlGkuU6kqzDv5DbIcQbqLS5AwhQ0os75BawFSmp0MgCknkBNl5FdxOHj4zyNF7QOvD4Eeyyg0+vkDZr3PDGPbzhApDILnfdirftZ7B95FBAyAYr19BQ+4pUCq0dIPL0QkL+qNvYDgYgPwOox+bnFc5y25gFWWOPB6+ZKLndvUWJ5uIpOemMZZUatCzzK/g/tLbSiioynkZYdq2017MWbmq5F7JoORa3e33p1/gIknsDuD0RTejghUeeGWpcbnuuVqR66TA/Ao+8Ea/YRZG2g72E2SqhWJtbejYVWRi3DX70etDcCL83YyWIL5o5y21WZf2aU4YkkCqWmkr/wrtjIPDT/3RG54ngxcN25ujWmAt08zFoXZ3EjjO9Clpsl2ZNfAcYmaBypUsnlwWZ3KxxkqMdGZpW7vJNFAgzM5Ldiep3F4KqA16TTpKyUF+jB+6eL3QpVNtonY0VYFdmGNSnix3ZmSynH+1Nmg==

>I don't think that there is any way to declare to coq that two universe levels should be incomparable

You can enforce that a definition produces no new constraints, for instance

~~~coq
Universes sf2 sf1 sf0.
Constraint sf0 < sf2.
Constraint sf1 < sf2.

Parameter t1 : Type@{sf0}.
Parameter t2 : Type@{sf1}.

Parameter test : Type@{sf0} -> Prop.
Fail Definition foo@{|} := test t2.
(* universe constraints are not implied by the ones declared *)
~~~

Gaëtan Gilbert

On 22/04/2020 18:00, Kenji Maillard wrote:
Hi Richard,

What do you want to achieve exactly ?

I don't think it is exact to say Coq's universe levels form a total order: at any point of a Coq development the universes together with their constraints form a finite graph without any cycle containing a strict edge (<). However you could always map such a graph to a total order by adding more constraints.

In your example, you can see by printings universes that (test t2) adds a constraint sf1 <= sf0 (at least if you add a `Definition x := test t2.`) so that your universe graph is not a tree anymore (and I don't think that there is any way to declare to coq that two universe levels should be incomparable).

Cheers,

Kenji

Le 22/04/2020 à 17:27, richard Dapoigny a écrit :

Thanks for your prompt answer. Let us consider the following test :

Universes sf2 sf1 sf0.
Constraint sf0 < sf2.
Constraint sf1 < sf2.

Parameter t1 : Type@{sf0}.
Parameter t2 : Type@{sf1}.

Parameter test : Type@{sf0} -> Prop.
Check (test t1).
(* we expect that sf0 and sf1 are two branches under sf2 and that the following test fails *)
Check (test t2).


Le 22/04/2020 à 17:12, Gaëtan Gilbert a écrit :
I don't understand what you mean, perhaps you could show some example code which does something you didn't expect or want?

Gaëtan Gilbert

On 22/04/2020 17:08, richard Dapoigny wrote:
Dear Coq Members,
We are using the Coq hierarchy of polymorphic universes which has been recently implemented by Sozeau.
We want to use it for subtyping and we expect it to be an implementation of Grothendieck universes, however it seems to be a total order. Therefore we cannot have a tree-like hierarchy.
However is it possible to ultimately have that structure?
Thanks for your answer,
Richard

--
*Richard Dapoigny*
/Associate Professor/ - LISTIC Laboratory
University Savoie Mont-Blanc
5, chemin de Bellevue
Po. Box 80439
Annecy-le-Vieux 74940
FRANCE
https://www.listic.univ-smb.fr/en/presentation-en/members/lecturers/richard-dapoigny-en/

/****** People who don't know history are condemned to repeat it. ******/

--
*Richard Dapoigny*
/Associate Professor/ - LISTIC Laboratory
University Savoie Mont-Blanc
5, chemin de Bellevue
Po. Box 80439
Annecy-le-Vieux 74940
FRANCE
https://www.listic.univ-smb.fr/en/presentation-en/members/lecturers/richard-dapoigny-en/

/****** People who don't know history are condemned to repeat it. ******/




Archive powered by MHonArc 2.6.18.

Top of Page