Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] sigT and Prop

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] sigT and Prop


Chronological Thread 
  • From: Gaëtan Gilbert <gaetan.gilbert AT skyskimmer.net>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] sigT and Prop
  • Date: Mon, 23 Sep 2019 11:49:39 +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 relay6-d.mail.gandi.net
  • Ironport-phdr: 9a23:xymoWhTklxr5N9W9cNzrssx5Kdpsv+yvbD5Q0YIujvd0So/mwa6ybRyN2/xhgRfzUJnB7Loc0qyK6vumAzxLuMbJ8ChbNsAVDVld0YRetjdjKfbNMVf8Iv/uYn5yN+V5f3ghwUuGN1NIEt31fVzYry76xzcTHhLiKVg9fbytScbdgMutyu+95YDYbRlWizqhe7NyKwi9oRnMusUMjoZuN6g8xgHXrnZLdOha2GBlLk+Xkxrg+8u85pFu/zlOt/4768JMTaD2dLkkQLJFCzgrL3o779DxuxnZSguP6HocUmEInRdNHgPI8hL0UIrvvyXjruZy1zWUMsPwTbAvRDSt9LxrRwPyiCcGLDE27mfagdFtga1BoRKhoxt/w5PIYIyQKfFzcL/Rcc8cSGFcWclfSjFBApikb4QRE+UBIehWr474p1QUrBu+AxSnCOfgxzJMg3P727Ax3eY8HgHcxAEuAswAsHrUotv2OqkdX++6w6vUwjvMdP5WxTTw5ZLUfhw9r/yBX7R9etfRx0k1EAPFi02dp43/MDSJyuQCqW6b4PJhW+Kuj24osB9+oiKzxswxjYTJiZgaxU7Y9SpjxoY5P9K4SE9/YdG/DpRQrT2aOpBtQsMhQ2BooyU6yrwDuZ6+YicK0o4rxxjBZPybaoWF5A/oWuiWITd9nn1lebS/ig698Uih1u38VtS0301QoipEldnBsG0G2R/L6sWfVPdx40Ws1SyN2gzP8O1IPEM5mKTBJ5I8xrM9lYIfvEvCEyPshUn7iKGbel8r9+Sy9ujqYanqq5mBPIFukA7+KL4hmsmnDOQ4LAcOW2+b9Pym1LL9+U32WrVLg/wvnqbEqpzaIN4Upq+9AwNP3YYs8RC/ACqn0NgCm3kIMk5FdAqGj4jvJV7OPOj1Aemij1muijtmxezKMqf8DpjOIHXPiqrtcLJ+5kJEzQo819Ff55ZaCrEbJ/LzX1f8tNPCARAnLwy72eDnBM9y1oMfXWKAGbGWMLnOsVKT/eIvIOmNZJQWuDb8Lvgl4uDhjWUjlV8bY6apwYMbaGqkEfR+P0WZfX3sj88dHmcNpwoyVfDliFmfUTFIfHuyRKI95jQjCI28F4vDR4atgKaA3CihBJFWaHpGWRiwFiLjcJzBUPMRYgqTJNVgm3oKT+uPUYgkgD6nNxPzzY1IL+7e9zcE/cbs3dVp7uuVmhA2/zFuE+yG0HCWTGBxm24SATk7wPYs8gRG1l6f3P0g0LRjHttJ6qYVA15nZ66Z9PRzDpXJYiyEftqNTwz7EM+rBTggEJc9hdoHYkI7FNykghGF2Se2UedMxu67Qacs+6eZ5EDfYsN0ynLIzq4k1gd0WcheLm6ng6ty7U7VCpKbyhzFxZbvTrwV2Wv2zEnG1XCH5R8KSw1hSqbEWHUSfA3QoMirvk4=

This works because sigT is "template universe polymorphic" https://coq.github.io/doc/master/refman/language/cic.html#template-polymorphism which makes every application inhabit as low a universe as the arguments allow.

There's also "universe polymorphism" https://coq.github.io/doc/master/refman/addendum/universe-polymorphism.html which is more regular (eg can be used for any definition rather than just inductives) but currently cannot be instantiated with Prop.

Gaëtan Gilbert

On 23/09/2019 05:05, Jeremy Dawson wrote:

Hi,

I have an example where I'm confused about the rules regarding types.

I have a function GiT of the following type

ljt_dec < Check GiT.
GiT : list PropF -> PropF -> nat -> Prop

ljt_dec < Check (GiT Γ P 0).
GiT Γ P 0 : Prop

The following is accepted without a type error

ljt_dec < Check (existsT2 d : nat, GiT Γ P d).
existsT2 d : nat, GiT Γ P d : Set

existsT2 is notation for sigT ...

ljt_dec < Check (sigT (fun d : nat => GiT Γ P d)).
existsT2 d : nat, GiT Γ P d : Set

ljt_dec < Check sigT.
sigT : forall A : Type, (A -> Type) -> Type

but sigT wants a body of type Type (ie nat -> Type)
but in the example works with a body of type
(nat -> Prop)

and sigT should return result type of Type, but here
returns a result of type Type

Sometimes (often) coq objects when you get Prop, Set and
Type mixed up, and use the wrong one, here not at all.

I'd like to understand why this is so

Thanks

Jeremy




Archive powered by MHonArc 2.6.18.

Top of Page