coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Vadim Zaliva <vzaliva AT cmu.edu>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] non-automatic type class resolution
- Date: Thu, 1 Sep 2016 18:57:55 -0700
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=vadim.zaliva AT west.cmu.edu; spf=Pass smtp.mailfrom=vadim.zaliva AT west.cmu.edu; spf=None smtp.helo=postmaster AT mail-wm0-f43.google.com
- Ironport-phdr: 9a23:Kl5EqBAIo67JM4FxMNRlUyQJP3N1i/DPJgcQr6AfoPdwSP7/rsbcNUDSrc9gkEXOFd2CrakV0qyL6eu9CCRAuc/H6yFaNsQUFlcssoY/p0QYGsmLCEn2frbBThcRO4B8bmJj5GyxKkNPGczzNBX4q3y26iMOSF2kbVImbtr8FoOatcmrzef6o8SVOFQRwmfnKu4jZFXu9EOK55FQ2dMjYo8KiTLx6kNSfOpXwW46bXmypD3bovmKwZh47i5LsOgg/cMTGY/zfqA/UKAKRG9+azN9t4XXskzIShLK7X8BWE0XlABJCk7L9kLURJD05xXzuut4kBuTOczoRPhgRyar66Z1QTfjjTpBOjIkpjKEwvdshb5W9Ury7yd0xJTZNdmY
On Thu, Sep 1, 2016 at 4:38 PM, Jonathan Leivent <jonikelee AT gmail.com> wrote:
Is this sufficient?:
Class A (n:nat) : Prop.
Definition f (n:nat)`{A n} := n.
Definition g (n:nat) := n.
Lemma Foo: exists w, forall x, @f (g x) (w x) = x.
unshelve eexists.
Neat trick! Thanks.
If I want to use Foo for rewriting, I guess I have to do something like this:
Lemma Foo_Test:
exists w, 5 + @f (g 1) (w 1) = 5 + 1.
Proof.
elim Foo.
intros A_g H.
exists A_g.
rewrite H.
reflexivity.
Qed.
In more complex cases, where one have several type class instance evars, dependent on each other I suspect using this approach could become unwieldy.
P.S. I have just seen your message with an alternative way, swapping exists and forall. I will play with it now to see if it works any better for rewriting.
Thanks!
- [Coq-Club] non-automatic type class resolution, Vadim Zaliva, 09/02/2016
- Re: [Coq-Club] non-automatic type class resolution, Jonathan Leivent, 09/02/2016
- Re: [Coq-Club] non-automatic type class resolution, Jonathan Leivent, 09/02/2016
- Re: [Coq-Club] non-automatic type class resolution, Vadim Zaliva, 09/02/2016
- Re: [Coq-Club] non-automatic type class resolution, Jonathan Leivent, 09/02/2016
- Re: [Coq-Club] non-automatic type class resolution, Jonathan Leivent, 09/02/2016
- Re: [Coq-Club] non-automatic type class resolution, Jonathan Leivent, 09/02/2016
- Re: [Coq-Club] non-automatic type class resolution, Jonathan Leivent, 09/02/2016
Archive powered by MHonArc 2.6.18.