Skip to Content.
Sympa Menu

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

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Parametricity


chronological Thread 
  • From: Peter LeFanu Lumsdaine <p.l.lumsdaine AT gmail.com>
  • To: Adam Chlipala <adam AT chlipala.net>
  • Cc: Daniel Schepler <dschepler AT gmail.com>, coq-club AT inria.fr, David Baelde <david.baelde AT gmail.com>
  • Subject: Re: [Coq-Club] Parametricity
  • Date: Wed, 30 Mar 2011 16:32:37 -0300
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=wOR297xl6ahbHPUrNGYcZJce04APU5PvseQuMa1kahL65wxboNnNmsfer7LT/0dfU+ sUuZ3ixuZ64eOlGwYCtTV1qWQXjgM8lOO7NL/uX677P8iHsB5XbuaMi2wBEoy5dcVjd9 RmD2X206M/xYMk2oaA1up2GTrkqBZ4DNqut5E=

>> On Wednesday 30 March 2011 07:13:22 David Baelde wrote:
>>
>>> […] can we prove from inside Coq that any
>>> function of type (forall A:Type, A ->  bool) is extensively equal to
>>> some constant function?

> Daniel Schepler wrote:
>>
>> No, if you add
>>   Axiom classic_dec: forall P:Prop, {P} + {~P}.
>> then you can define
>>   Definition inhabited_bool (A:Type) : bool :=
>>     if classic_dec (inhabited A) then true else false.

On Wed, Mar 30, 2011 at 2:43 PM, Adam Chlipala 
<adam AT chlipala.net>
 wrote:
>
> Is this function really a counterexample?  It doesn't include the argument
> of type [A] from the original question.

Once one has the decidability axiom, one can certainly find plenty of
counterexamples; for instance, the function defined as “the identity
on bool, or the constantly true function on any other type”:

Axiom classic_dec: forall P:Prop, {P} + {~P}.

Definition non_parametric : forall A:Type, A -> bool.
intros A.
case (classic_dec (A = bool)) as [ A_eq_bool | A_neq_bool ].
  (* case A = bool *)
  intros x.  rewrite A_eq_bool in x.  exact x.
  (* case A <> bool *)
  intros x.  exact true.
Defined.

So again, if the decidability axiom is consistent (and as I
understand, it is generally believed to be) then parametricity is not
provable.

–Peter.




Archive powered by MhonArc 2.6.16.

Top of Page