Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Inductive types and isomorphisms....

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Inductive types and isomorphisms....


Chronological Thread 
  • From: Morrisett <morrisett AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Inductive types and isomorphisms....
  • Date: Sun, 6 May 2018 13:21:53 -0400
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=morrisett AT gmail.com; spf=Pass smtp.mailfrom=morrisett AT gmail.com; spf=None smtp.helo=postmaster AT mail-qt0-f179.google.com
  • Ironport-phdr: 9a23:olIcrhQ11wct6LIvkaFpQddTkNpsv+yvbD5Q0YIujvd0So/mwa69ZRGN2/xhgRfzUJnB7Loc0qyK6/umATRIyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+KPjrFY7OlcS30P2594HObwlSizexfb1/IA+qoQnNq8IbnZZsJqEtxxXTv3BGYf5WxWRmJVKSmxbz+MK994N9/ipTpvws6ddOXb31cKokQ7NYCi8mM30u683wqRbDVwqP6WACXWgQjxFFHhLK7BD+Xpf2ryv6qu9w0zSUMMHqUbw5Xymp4qF2QxHqlSgHLSY0/mHLhcJ/g61Vrg+vqR9xw4HWfo+bM+Fzfr/EfdMfWWZBXtpdWi5HD4ihb4UPFe0BPeNAoof6oFsOtwG+BQi3BOzx1j9ImmL90Ko/0+QmCwHGxg0gH8kQv3TIsNX4L6gSUeWvw6nJyTXPde9Z2TD46IXRdB0qvPKCXapofMbP1UUiExnJg1aQpID/IT+Zy+UAv3KG4+diUe+jk3Arpg5rrjSyxsohiJPFi4Mbx1ze+yh0z4A4LsCiRkFhe96rCp5QujmaN4RoRsMiRHlluCMgxb0HvZ63ZTEKyIg7yxLGZfyLboqF7xb5WOaeJjd4g31leLahiBqo7Uegzej8WtG10FZMsCVFjsHBum4R2xHX8MSKSftw8l2/1TqS1g3f8PxILEIwmKbDLp4u2L8wlp4dsUTZGS/2nV37jKqRdkU+4Oio6v/nbav6pp+ALIJ0hQT+Pb4vmsy7G+g3Lg8OX22D9eSmyLLj5VH5QKlNjvAujqbZt4naKd0Hqa69Hg9ayZ0u6w2/DjejyNQXh2MLLFNDeBKdjojmIUvCIP7iDaT3v1P5mzBygvvCI7fJA5PXL3GFnq2yU6x67ht5zxApzMtS+44cXrQGOujyQULtqPTXCxY4N0q/xOOxW4Y17Z8XRW/aWvzRC6jVq1Ldvrt+cdnJX5ccvXPGE9Zg4vfviXEjnlpEJPum2JIWbDazGfE0ehzFM0qpuc8IFCIxhiR7VPbj0QTQXjtaZnL0VKU5tGliVdCWSLzbT4Xou4SvmSe2GpoMODJDA1GIVG70L8CKAqhdLi2VJcBln3oPUr3zE4I=

You might look at Abhishek Anand’s parametricity plug in. This lets you do
this.

-Greg

> On May 6, 2018, at 10:24 AM, Fred Smith
> <fsmith1024 AT gmail.com>
> wrote:
>
>
> Hi,
>
> I have thoroughly confused myself, and hope someone can help straighten me
> out. I started down this question trying to understand how to abstract an
> interface away from the actual implementation, and it occurred to me that
> the question is very general.
>
> Suppose I define my own "natx" that is in every way equivalent to "nat"
> except I rename the constructors "Sx" and "Ox". It is straightforward to
> write coercions from natx into and out of nat and prove these form a
> bijection. I would like to think that I can now "import" all of the rich
> theory surrounding nat and make it available for my type natx.
>
> I have half-convinced myself that this is possible through writing trivial
> wrappers. My first question is: is there a hole? Is there something I
> cannot import nearly for free? I expect problems around higher-order
> arguments but it looks like it works out?
>
> Still, all this work to write wrappers seems unnecessary. Conceptually the
> unique thing about nat is not the name "S" and "O" but its structure.
> Therefore, I ought to be able to write a Module Type interface hiding this
> detail. Then if all of the proofs about "nat" were parameterized by this
> interface, I could very easily get all the theory for "nat" for free for
> natx.
>
> My contrived example does not seem so interesting, but suppose I found some
> sub-structure that was isomorphic to nat then suddenly this might be much
> more interesting. (I don't have an actual example, just imagining one)
>
> Where I am stuck is writing this Module Type interface. I can't seem to
> come up with anything that can serve as a computational replacement for nat
> without effectively exporting an inductive type exactly like nat. My
> interface can contain nat_ind which is fine for reasoning about
> propositions (at least it seems fine), but I have been unable to produce
> any useful definition that will let me define "plus". I guess I need the
> equivalent of nat_rect but if the definition isn't transparent, I don't
> think you can prove anything about it.
>
> Thanks for your help,
>
> Fred
>



Archive powered by MHonArc 2.6.18.

Top of Page