Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Why do we have "Prop < Set" ? Why not just "Prop ≤ Set" ?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Why do we have "Prop < Set" ? Why not just "Prop ≤ Set" ?


Chronological Thread 
  • From: Matej Košík <universe.inconsistency AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Why do we have "Prop < Set" ? Why not just "Prop ≤ Set" ?
  • Date: Sun, 22 Jan 2017 12:36:20 +0100
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=universe.inconsistency AT gmail.com; spf=Pass smtp.mailfrom=universe.inconsistency AT gmail.com; spf=None smtp.helo=postmaster AT mail-wm0-f65.google.com
  • Ironport-phdr: 9a23:bBcgeh30grU7PyqasmDT+DRfVm0co7zxezQtwd8ZseIXLfad9pjvdHbS+e9qxAeQG96Kt7QY1KGM4+jJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fdbghMizexe7x/IRe5oQnPtcQdnJdvJLs2xhbVuHVDZv5YxXlvJVKdnhb84tm/8Zt++ClOuPwv6tBNX7zic6s3UbJXAjImM3so5MLwrhnMURGP5noHXWoIlBdDHhXI4wv7Xpf1tSv6q/Z91SyHNsD4Ubw4RTKv5LptRRT1iikIKiQ5/XnKhMJugqJVoBGvqRJxzIHbYo6aKPVwc7jBfd4ZX2dNQtpdWiJDD466coABD/ABPeFdr4TloFUBtwe+CheuBOjyzzFIgXD12rM50+88FgzGwQogH9MQsHvKttX1L7kdXfq0zKnO0TrDaPVW2Sz86IjTbhAuv/eMUq5wcMfKxkkvEhnKjlSUqYD/IzyV0eENvnGd4uF9W+yvjGsnpBtwojip3sosi4/JhoMJylze+yR5zoA4LsC7Rk5jedOpEpRduzuHO4doQs4uWWJltDggxrAHuZO3ZDYGxIkpyhLFZPGLbpKE7xPtWeqLPDt0mXRoc6+liRmo60iv0Oj8W9G00FlUqipFlcHBtnUX2BzS7siLU/V8/kK91TqW2QDe6+FJLVo7larcLJ4hzbowmYQJvUvfGS/2nV36jK6Qdko65uil8+bqb7r8qpOBKYN5ihvyP6cwlsClAOk1MhACX22B9uS90L3j81f5QLJPjvAuj6nZtpHaJdoFqa6jGA9azJwv6xe5Dzi619QYm2IHLFNeeBKbkYfpPU3BIfDjAPewhlSjijZrx/TcMrL9BZXNK2DPkK39crZl905c1A0zwMhD6JJTE7ENOe78WkvstNPDFRI5KAy1w+P/CNpnzI8eWGSPArWYMKzIq1OI6PgvcKGwY9oevy+4IPw47dbvi2U4kBkTZ/qHx5wSPVWxAvlka2aek//vyoMcF2YUsxAlQarrjlaFVyVSfGq/Waktzj4+AYOiS4zEQ9b+0/S6wC6nE8gONSh9AVeWHCKweg==

Hi Jason,

On 01/21/2017 07:59 PM, Jason Gross wrote:
> Matej,
>
> With your branch of Coq:
>
> Set Universe Polymorphism.
> Definition foo@{i j} (x : Type@{i}) := x : Type@{j}.
> Set Printing Universes.
> Section foo.
> Universe i.
> Constraint i = Prop. (* works fine in your branch, fails in standard Coq
> with Error: Universe inconsistency. Cannot enforce i = Prop because Prop <
> Set <= i. *)
> Definition bar := foo@{Set i}.
> End foo.
> Eval compute in bar nat. (* = nat : Prop *)
> Definition natP : Prop.
> Proof.
> let v := (eval compute in (bar nat)) in exact v.
> Defined.
> Print natP. (* natP = nat
> : Prop
> (* |= Prop = Set
> *) *)
>
> I had to jump through some hoops to work around other ad-hoc restrictions
> that prevent collapsing things to Prop (polymorphic universes can't
> normally be instantiated with [Prop], even when you relax
> Prop < Set; monomorphic universes are always strictly greater than Set, the
> subtyping relation must special-case Prop and Set in some places, rather
> than going through the generic universe comparison
> algorithm.)

Wouldn't the following example (in my branch):

Constraint Set <= Prop.

Check nat : Prop. (* does not fail --- unsurprisingly *)

achieve the same?

(* so far, I wasn't aware that there is this "Constraint" command so I did
not know that this kind of thing is possible *)

I guess that there is nothing to be gain (?) by letting the user to do that
(or is there?).

Can that be the reason why we absolutely must insist on "Prop < Set" instead
of just on "Prop ≤ Set"?

>
> Regarding your question
>> I wonder why Coq infers that.
> The command [Print Sorted Universes] collapses all universes to the minimal
> universe they can inhabit.

Why?

> If you include the prelude and [Print Sorted Universes], all of the
> universes in the prelude get
> collapsed to Type.0. So since you don't have Prop < Set, Coq infers that
> Set can be collapsed to Prop.

That statement is not consistent with my experiments.

Coq < Print Sorted Universes.
Coq.Init.Logic_Type.6 = Type.0
Coq.Init.Logic_Type.5 = Type.0
Coq.Init.Logic_Type.4 = Type.0

<snip>

Coq.Init.Wf.3 = Type.0
Coq.Init.Wf.2 = Type.0
Coq.Init.Wf.1 = Type.0
Set < Type.0
Prop = Set

The surprising behavior (of Coq in my branch) is, I believe, this:

Welcome to Coq trunk (January 2017)

Coq < Print Sorted Universes.
Prop = Set

(* I still do not understand how could "Prop = Set" follow from "Prop ≤
Set". *)

(* Fortunatelly, even though Coq prints "Prop = Set", it does not really
mean it ... *)

Coq < Check fun A:Set => (A:Prop).
Toplevel input, characters 20-21:
> Check fun A:Set => (A:Prop).
> ^
Error:
In environment
A : Set
The term "A" has type "Set" while it is expected to have type
"Prop" (universe inconsistency).

(* ... so we are safe. Just that the output of "Print Sorted Universes."
cannot be take literally :-/. *)

(* Now, after I do ... *)

Coq < Constraint Prop = Set.

Coq < Print Sorted Universes.
Prop = Set

(* ... I get the same output of the "Print Sorted Universes." command as
before; but *this time* Coq really means it: *)

Coq < Check fun A:Set => (A:Prop).
fun A : Set => A : Prop
: forall _ : Set, Prop



Archive powered by MHonArc 2.6.18.

Top of Page