coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Maximilian Wuttke <mwuttke97 AT posteo.de>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Parametricity Axiom
- Date: Sat, 20 Feb 2021 01:33:15 +0100
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=mwuttke97 AT posteo.de; spf=Pass smtp.mailfrom=mwuttke97 AT posteo.de; spf=None smtp.helo=postmaster AT mout01.posteo.de
- Ironport-phdr: 9a23:Ix2QaxOW4StLr59JT/Il6mtUPXoX/o7sNwtQ0KIMzox0Iv3yrarrMEGX3/hxlliBBdydt6sVzbWI+Pm6BiQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTagZb5+Nhe7oATeusULn4dvKLs6xwfUrHdPZ+lY335jK0iJnxb76Mew/Zpj/DpVtvk86cNOUrj0crohQ7BAAzsoL2465MvwtRneVgSP/WcTUn8XkhVTHQfI6gzxU4rrvSv7sup93zSaPdHzQLspVzmu87tnRRn1gyoBKjU38nzYitZogaxGvhyhqRxxzY3abo6bO/VxfL/Sc9wBSGpdXMtcTTBNDp+yYoYNCecKIOZWr5P6p1sLtRawAhOjBezuyj9Nh3/22aw63P4nEQrb3AMgAs4OsGjXrNrrKawfVuW1zafVzTXfc/NW2iny5YzKfx06ufGMWqlwcdbPxkkoDQ/Kk0ufpJXjMjiI2esDr3KV4PB8VeKzlWEnsQdxryCxy8kshITEiZ4Zx17Z+Sh7wIs4Jd22RVN7bNO4DpZdsy+XOol4TM0iXm1luSY3xqMItJKnfiUH1JUqyh/QZvKJdYWD/xHtVP6JLDtlh39oeKizihew/ES6xODxV9O43VdKoyZdkdTBsmoB2wHc58WGUPdx4Fmt1SqV2wzO5OxIPUY5nrfBJZE72L4/jJ8TvFzDHiDonEX2i7ebdkAj+ui19+TrfqjqqoWEN49zkQH+LrohmsulDeslLAcCR2mb+eKi273/5UD1XbZHg/0snqTYsp3WP8oWq6+jDwJU0osv8xO/AC2n0NQck3kHNlVFeBefgojsNVDOPez4Deu8g1uylDpmxevLPqXmApXWMnjMjrDhcaxg5EFC0AYz18xQ54pICrEdJ/L+QlP+tNvBDhMgLwO0x/vnB85m24MFWWOPB7eZP7nIvV+J4OIvOeiMa5UPtDbzMfh2r8Lp2HQ+gBoWebSj9ZoRcnGxWPp8cGuDZn+5p94REGILugs3SqTVlUGeUjMbM3OtQr4g5TxqV6q+CpzfS4frjLHXj3TzJYFfem0TUgPEKnzvbYjRA65dOhLXGddol3k/bZbkToYg0R+0swqjkuh/KfHI9ypeuZ+xjYEptd2Wrgk78HlPN+rYy3uEFjgmhmQTWzIxmqxy8xQklwWzlJNgivkdLuR9ovNEVgBjZczZyPFmU4m0QgXaYtqODlqrEI2r
On 20/02/2021 00:33, Daniel Schepler wrote:
> What if you assume the axiom classic_dec : forall P : Prop, {P} + {~P}
> and then define something along the lines of:
> Definition f := fun (X : Type) =>
> match classic_dec (bool = X) with
> | left Heq => match Heq in (_ = X') return ((unit -> X') -> X') with
> | eq_refl => fun i => bnot (i tt)
> end
> | right _ => fun i => i tt
> end.
>
> That axiom should be consistent in Coq: after all, it's implied by the
> conjunction of classic : forall P : Prop, P \/ ~P and
> definite_description : forall (A : Type) (P : A -> Prop), exists! x:A,
> P x -> { x:A | P x }.
Yes, this is enough to convince me that the parametricy axiom is not
provable in Coq, but it might sound to admit it on its own.
See the proof script below. Note that I changed [X : Type] to [X : Set],
due to universe inconsistencies.
> Section Challenge.
>
> Variable classic_dec : forall P : Prop, {P} + {~P}.
> Variable UIP_refl : forall (X : Type) (x : X) (H : x = x), H = eq_refl.
>
> Definition f :=
> fun (X : Set) => (* Note that I changed the sort of [X] to [Set] *)
> match classic_dec (bool = X) with
> | left Heq => match Heq in (_ = X') return ((unit -> X') -> X') with
> | eq_refl => fun i => negb (i tt)
> end
> | right _ => fun i => i tt
> end.
>
> Variable tam : forall (f : forall X : Set, (unit -> X) -> X),
> forall (X : Set) (i : unit -> X),
> f X i = i tt.
> Goal False.
> specialize (tam f bool (fun _ => true)); unfold f in tam.
> destruct (classic_dec (bool = bool)); cbn in *; try tauto.
> pose proof UIP_refl _ _ e as ->.
> discriminate.
> Qed.
>
> End Challenge.
This is just another reminder that we ought to be careful about which
axioms we admit ;-)
-- Maximilian
PS: Fortunately, I didn't need this axiom mentioned in the first mail.
Using it would have spared me over 1k boilerplate LOC though. Basically,
I have used instances of this axiom for some classes of functions [f].
- [Coq-Club] Parametricity Axiom, Maximilian Wuttke, 02/18/2021
- Re: [Coq-Club] Parametricity Axiom, Dominique Larchey-Wendling, 02/18/2021
- Re: [Coq-Club] Parametricity Axiom, Maximilian Wuttke, 02/19/2021
- Re: [Coq-Club] Parametricity Axiom, Dominique Larchey-Wendling, 02/19/2021
- Re: [Coq-Club] Parametricity Axiom, Pierre-Marie Pédrot, 02/19/2021
- Re: [Coq-Club] Parametricity Axiom, Hugo Herbelin, 02/19/2021
- Re: [Coq-Club] Parametricity Axiom, Maximilian Wuttke, 02/21/2021
- Re: [Coq-Club] Parametricity Axiom, Christian Doczkal, 02/21/2021
- Re: [Coq-Club] Parametricity Axiom, Maximilian Wuttke, 02/21/2021
- Re: [Coq-Club] Parametricity Axiom, Maximilian Wuttke, 02/19/2021
- Re: [Coq-Club] Parametricity Axiom, Daniel Schepler, 02/20/2021
- Re: [Coq-Club] Parametricity Axiom, Maximilian Wuttke, 02/20/2021
- Re: [Coq-Club] Parametricity Axiom, Daniel Schepler, 02/20/2021
- Re: [Coq-Club] Parametricity Axiom, Thorsten Altenkirch, 02/23/2021
- Re: [Coq-Club] Parametricity Axiom, Maximilian Wuttke, 02/20/2021
- Re: [Coq-Club] Parametricity Axiom, Daniel Schepler, 02/20/2021
- Re: [Coq-Club] Parametricity Axiom, Hugo Herbelin, 02/19/2021
- Re: [Coq-Club] Parametricity Axiom, Maximilian Wuttke, 02/19/2021
- Re: [Coq-Club] Parametricity Axiom, Dominique Larchey-Wendling, 02/18/2021
Archive powered by MHonArc 2.6.19+.