Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Parametricity Axiom

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Parametricity Axiom


Chronological Thread 
  • From: Christian Doczkal <christian.doczkal AT inria.fr>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Parametricity Axiom
  • Date: Sun, 21 Feb 2021 13:08:57 +0100
  • Organization: INRIA

Hi

> > Variable classic_dec : forall P : Prop, {P} + {~P}.
> > Fail Check forall (X : Type), classic_dec (bool = X).
> > (* The term "X" has type "Type" while it is expected to have type
> > Set *)

> I think this is because bool has sort Set and we thus can't compare
> bool and Type. I don't know enough about universes, but maybe there
> is something like a universe polymorphic version of bool, such that
> this equality is well-typed?

This is just an artifact of type inference for "eq", which always tries
to type the RHS with the type assigned to the LHS ("Set" in this case).
The variants below are accepted:

Variable classic_dec : forall P : Prop, {P} + {~P}.
Check fun (X : Type) => classic_dec (bool = X :> Type).
Check fun (X : Type) => classic_dec (X = bool).

(Note that you also need a (fun => _) as (classic_dec P) is not a
type.)

Best,
Christian




Archive powered by MHonArc 2.6.19+.

Top of Page