Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Why subtyping rule is not contravariant in input types for Pi

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Why subtyping rule is not contravariant in input types for Pi


Chronological Thread 
  • From: Xavier Leroy <xavier.leroy AT college-de-france.fr>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Why subtyping rule is not contravariant in input types for Pi
  • Date: Thu, 20 Jun 2024 19:41:05 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=xavier.leroy AT college-de-france.fr; spf=Pass smtp.mailfrom=xavier.leroy AT college-de-france.fr; spf=None smtp.helo=postmaster AT smtpout01-ext2.partage.renater.fr
  • Dkim-filter: OpenDKIM Filter v2.10.3 zmtaauth01.partage.renater.fr C547A14020D
  • Ironport-sdr: 667469cf_4dgogW1yb+cVwp9huxE07L2fLKEAMmEK7u9Z8OQD9/SVzfr 4R4mY7At5DGm7XO6d/GF0bzk2YWZM+CJ38nE0tg==



On Thu, Jun 20, 2024 at 5:12 PM Jason Hu <fdhzs2010 AT hotmail.com> wrote:
Hi all,


Rule 5 says that Coq only checks equivalence for the input types while only the output types are subject to subtyping. How is the subtyping rule is not contravariant in the input types?

I understand that in System F, this rule is problematic and causes undecidability but I don't think it applies here. In particular, if for the sake of discussion we let U <: T and compare x : U |- T' <: U', this extra information of x : U should affect the result of comparing T' <: U' at all.

It's not that obvious to me, since T' and U' can depend on x.

At any rate, in the non-dependent case, Coq's type-checker seems to simulate contravariance using eta-expansion:

Parameter F: Set -> Prop.

Check (F: Set -> Set).
(*
F : Set -> Set
     : Set -> Set
*)

Check (F: Prop -> Set).
(*
(fun x : Prop => F x) : Prop -> Set
     : Prop -> Set
*)
- Xavier Leroy


How is the rule designed in this way? What consideration am I missing here?




Archive powered by MHonArc 2.6.19+.

Top of Page