coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Thorsten Altenkirch <Thorsten.Altenkirch AT nottingham.ac.uk>
- To: "coq-club AT inria.fr" <coq-club AT inria.fr>, Igor Zhirkov <igorjirkov AT gmail.com>
- Subject: Re: [Coq-Club] Mu combinator
- Date: Wed, 30 Mar 2016 16:02:36 +0000
- Accept-language: en-US, en-GB
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=Thorsten.Altenkirch AT nottingham.ac.uk; spf=None smtp.mailfrom=Thorsten.Altenkirch AT nottingham.ac.uk; spf=None smtp.helo=postmaster AT uidappmx05.nottingham.ac.uk
- Ironport-phdr: 9a23:c9hpPBHRquR79tfVdSkY951GYnF86YWxBRYc798ds5kLTJ74psSwAkXT6L1XgUPTWs2DsrQf27qQ6fCrCDZIyK3CmU5BWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYsExnyfTB4Ov7yUtaLyZ/nh6boq9aCOU1hv3mUX/BbFF2OtwLft80b08NJC50a7V/3mEZOYPlc3mhyJFiezF7W78a0+4N/oWwL46pyv50IbaKvNa8/VPlTCCksG2Ez/szi8xfZB0Pb7XwFF24SjxBgAg7f7Ri8UI2n9mPbue1nkBuaPNf1Sq58DTWt6L1pSQXrjzkvODsw8WWRgct12vF1uhWk8iB/xJTPfIyTfNN6Yq7bftIATmoJCvpRUDZaHo66KaILE+cHPudCpInVoVwSsRq4CgmlAaXmwXlVhSmljuUBz+09HFSej0QbFNUUvSGMoQ==
Why not just using the Church encoding:
Definition Mu (f : Type -> Type) :=
forall x, (f x -> x) -> x
I need to know that f is a functor if I want to implement fold. I don¹t
see why this is a problem?
Is Type still impredicative in Coq? I guess this works only for Type(0)
because if you have several impredicative levels then Girard¹s paradox
applies.
I don¹t think it is a good idea to encode types using this impredicative
trickery: it is conceptually rather heavy (do I need to understand what it
means to quantify over all types to understand the natural numbers?)and
practically not very useful. Also you need to assume parametricity to
derive any induction principle.
Thorsten
On 30/03/2016 16:44, "John Wiegley"
<johnw AT newartisans.com>
wrote:
>>>>>> Igor Zhirkov
>>>>>> <igorjirkov AT gmail.com>
>>>>>> writes:
>
>> I wonder whether it is possible to define the Mu combinator in Coq in a
>> general way.
>
>Hi Igor,
>
>In many cases you can use a "Mendler-style Church encoding" of Mu:
>
> Definition Mu (f : Type -> Type) :=
> forall r, (forall x, (x -> r) -> f x -> r) -> r.
>
>Note that you only need to know f is a Functor at reduction time.
>
>However: this "Mu" may be "larger" in CiC than f (Mu f), which could have
>implications for what you're doing.
>
>--
>John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F
>http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2
This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please send it back to me, and immediately delete it.
Please do not use, copy or disclose the information contained in this
message or in any attachment. Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham.
This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system, you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation.
- [Coq-Club] Mu combinator, Igor Zhirkov, 03/30/2016
- Re: [Coq-Club] Mu combinator, Thorsten Altenkirch, 03/30/2016
- Re: [Coq-Club] Mu combinator, John Wiegley, 03/30/2016
- Re: [Coq-Club] Mu combinator, Thorsten Altenkirch, 03/30/2016
- Re: [Coq-Club] Mu combinator, John Wiegley, 03/30/2016
- Re: [Coq-Club] Mu combinator, Thorsten Altenkirch, 03/30/2016
- Re: [Coq-Club] Mu combinator, Gregory Malecha, 03/31/2016
Archive powered by MHonArc 2.6.18.