coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Agnishom Chattopadhyay <agnishom AT cmi.ac.in>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] How do I define this function for non-empty lists?
- Date: Thu, 29 Oct 2020 10:38:14 -0500
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=agnishom AT cmi.ac.in; spf=Pass smtp.mailfrom=agnishom AT cmi.ac.in; spf=None smtp.helo=postmaster AT mail.cmi.ac.in
- Ironport-phdr: 9a23:5i2jpR/5jGIxff9uRHKM819IXTAuvvDOBiVQ1KB31e4cTK2v8tzYMVDF4r011RmVBNqduqgP27OempujcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47xaFLIv3K98yMZFAnhOgppPOT1HZPZg9iq2+yo9JDffgdFiCC5bL9sIxm7rhjdvdQKjIV/Lao81gHHqWZSdeRMwmNoK1OTnxLi6cq14ZVu7Sdete8/+sBZSan1cLg2QrJeDDQ9LmA6/9brugXZTQuO/XQTTGMbmQdVDgff7RH6WpDxsjbmtud4xSKXM9H6QawyVD+/6apgVR3mhzodNzMh/27XhM5/gqJVrhyiuhJx3ZLbbZqPO/ZiZK7QZ88WSXZDU8tXSidPApm8b4wKD+cZIetYoI/9p1oVrRu+AgmsAf7kxyFIhnDswa06z+MhERnc0wM9H9IPsG7brdXoP6oVS++1w6/IzTTYb/NW3jf97ZPFfQwkofGNR75/a9bexVMuFwPDl1idr5HuMDyJ2OoXqWeb8/ZgWvy1i24hswx/ojmiytkyh4fGhowYyF/K+CVlzYs2ONG1VlB3bNC4HJVQuC+XM4t7TM0tTW9ntig3xaELtJCmcSYFyZkpyR/SZvqaeIaG5RLjUfyeITZ+hH99d7K/hgqy8Ui9yuLnTMW7zFFKri9Dn9LRtX4NzwTe5tWZRvZz5Eus2DiC2xrN5u1YL004j7TXJ4M/zrIoiJYfrUDOEjX1lUj2lqOaa0Qp9+my5+j6Ybjqu5mRPJJuhA7kKKQhgMm/DPw4MgcQW2ib/vyx1Lj58k34RLVGlOE5kqzYsJzAP8sUurS1Aw5T0oo76ha/CSmp0MgAkHUaMl5IdgiLgonnNl3UPvz0Efmyj06ynDt22fzKJrjhDY/MLnjHnrfhZ7F960tExQUpwtBf4ZNUCqoBIPL0X0/8r8DXDho4MwCu2enoFM9x1oIYWW6XGK+WLLvSsUOU5uIoO+SDeIgVuC/kJ/c54/7ukGQ2lEQGfaip2JsXcGq3Eu5nI0Wfe3rsg80OHX0EvgokH6TWjwiJVicWbHKvVYo94Cs6AcSoF9TtXIeo1ZWO2iagHppTLktGA0yQFm/he4WVUuZEPCudJM56kjsBfbOkSsko3levslmpmPJcMuPI93hA5trY399v6riLzExgxXlPF82Yllq1YSR0k2cPHmFk2al+pQp2z1bF2KM+gvoKTYUPtcMMaR8zMNvn98I/E8r7A1uTddKIDl+tBNSgU2loH4ABhuQWakM4IO2MyxXK3i6kGbgQzuXZD5k1tKvXmXn3dZ9w
Thanks! That worked.
What is the difference between Defined and Qed?
Also, is this method (i.e, transporting lemmas and functions from the standard library lists to my type) advisable for what I am trying to do?
On Thu, Oct 29, 2020 at 10:20 AM Gaëtan Gilbert <gaetan.gilbert AT skyskimmer.net> wrote:
If you do "cbv" in your proof, you will get the goal
match list_nil_dec nat nil with
| left _ => < 1 >
| right pr => match pr eq_refl return (nonEmpty nat) with
end :| 1
end = < 1 >
this means reduction is blocked by your lemma list_nil_dec.
If you change the Qed to Defined for list_nil_dec, reflexivity works.
Gaëtan Gilbert
On 29/10/2020 16:09, Agnishom Chattopadhyay wrote:
> Hi;
>
> For an application, non-empty lists occur naturally. One way to deal with this would be to define a type of non-empty lists and then all the necessary functions and lemmas for them.
>
> However, I am trying to recycle the theorems available in the standard library. To do this, I am defining a function which lifts functions on list to functions on my non-empty type provided they preserve non-emptiness.
>
> But I am facing some trouble with this. For example, I cannot prove the lemma simple <https://gist.github.com/Agnishom/573a697dab82ddb72360136014065f7f>, over here.
>
> What am I doing wrong?
>
> --Agnishom
- [Coq-Club] How do I define this function for non-empty lists?, Agnishom Chattopadhyay, 10/29/2020
- Re: [Coq-Club] How do I define this function for non-empty lists?, Gaëtan Gilbert, 10/29/2020
- Re: [Coq-Club] How do I define this function for non-empty lists?, Agnishom Chattopadhyay, 10/29/2020
- Re: [Coq-Club] How do I define this function for non-empty lists?, Jason Gross, 10/29/2020
- Re: [Coq-Club] How do I define this function for non-empty lists?, Agnishom Chattopadhyay, 10/29/2020
- Re: [Coq-Club] How do I define this function for non-empty lists?, Jason Gross, 10/29/2020
- Re: [Coq-Club] How do I define this function for non-empty lists?, Agnishom Chattopadhyay, 10/29/2020
- Re: [Coq-Club] How do I define this function for non-empty lists?, Gaëtan Gilbert, 10/29/2020
Archive powered by MHonArc 2.6.19+.