coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Bas Spitters <b.a.w.spitters AT gmail.com>
- To: Coq Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] Inductive types and isomorphisms....
- Date: Tue, 8 May 2018 20:59:01 +0200
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=b.a.w.spitters AT gmail.com; spf=Pass smtp.mailfrom=b.a.w.spitters AT gmail.com; spf=None smtp.helo=postmaster AT mail-yb0-f178.google.com
- Ironport-phdr: 9a23:/X5yihKX6b4T1jYNadmcpTZWNBhigK39O0sv0rFitYgeKP3xwZ3uMQTl6Ol3ixeRBMOHs6kC07KempujcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47xaFLIv3K98yMZFAnhOgppPOT1HZPZg9iq2+yo9JDffwtFiCChbb9uMR67sRjfus4KjIV4N60/0AHJonxGe+RXwWNnO1eelAvi68mz4ZBu7T1et+ou+MBcX6r6eb84TaFDAzQ9L281/szrugLdQgaJ+3ART38ZkhtMAwjC8RH6QpL8uTb0u+ZhxCWXO9D9QKsqUjq+8ahkVB7oiD8GNzEn9mHXltdwh79frB64uhBz35LYbISTOfFjfK3SYMkaSHJDUcZfVyJPDICyYZYRAeUdMuhVtJX9p0IUoBeiGQWgGOHixzlVjXH2x6061OEhHBnb0QM6BNIFrWnarM30NKcOTeC60rPIzS7eZP5Rwjjx8pLHfgovoP2WRrJwacvRyVUzFwzblFWQspfoPzyQ1usXsmib6/BsWv6oi24isgx8pCWkyMkrionMnI0Vy1bE+D1kz4YyJN20Ukl7YcSrEJdItiGaMZd2Td0mQ21ypSk11LsLsoO4cigS0Jkr2QLTZvidf4WL4h/vTvidLSp2iX5/Zb6yhRW//E69wePmTMa0ykxFri9dn9nMqH8N0xvT59CCSvRn/0eh3S+D1gDI5e1YOEw0m7fXJpwiz7IqmZoTtkPDHiDymErolqOZakIk+u2w5+TmZLXpuIOcOpdqhg3iNqkigM+yDOQiPgQQQmSW9/6w2KDh8ED6WLlKi+c5kqjdsJDUP8Qboau5DhdO3Yo58RmzFTmn3M4DnXkfLVJFZA6HgJbzO1HVO/34AvK/jE6tkDdv3fzJIrrhApDVInjZjLjhZap961JbyAcr0d9f4ItUBqgdL/L3R0/+r8fVDgQ5Mgyx2+boEs9x1oIYWWKVA6+WKrnesVGS5rFnH+7ZT4gM8B35NvJts/XplDoynUIXVaivx5oeLn6iSKdIOUKcNFDlmZ86CWYWogckV6S+ghuLFyEVfG6zQ74x/CoTB4evDIOFTYeo1u/SlBynF4FbMzgVQmuHFm3lIsDdA69VOXCiZ/R5mzlBboCPDooo1BWgrgj/kuM1Ie/d+ylevpXmhoEsu7/j0Coq/DkxNPyzlnmXRjgtzGwNTj4ymqt4pB4lkwrR4e1Dm/VdUOdrybZJXwM9b8COyuV7D5XjUFqEcI7WGBCpRdKpBTx3RdU0kYcD
Dear Michael,
Not entirely sure whether this is related to your question, but we
developed some setoid based universal algebra in math-classes.
One of the things we prove is that nat is the initial (commutative) semiring.
Our development of universal algebra includes the syntax of a semiring
in the way you describe it.
Type Classes for Mathematics in Type Theory (with Eelis van der Weegen).
http://dx.doi.org/10.1017/S0960129511000119
Best regards,
Bas
On Tue, May 8, 2018 at 7:07 PM, Soegtrop, Michael
<michael.soegtrop AT intel.com>
wrote:
> Dear Matthieu,
>
>
>
> may I ask a question: what if I don’t have an isomorphism but just a
> homomorphism. To give a concrete example think of nat and an inductive type
> encoding expressions on nat (including variables). I found it very helpful
> to declare typeclass instance like:
>
>
>
> Instance Equivalence_equiv : Equivalence equiv.
>
> Instance Proper_Const : Proper (eq ==> equiv) Const.
>
> Instance Proper_Var : Proper (eq ==> equiv) Var.
>
> Instance Proper_Add : Proper (equiv ==> equiv ==> equiv) Add.
>
> Instance Proper_Mul : Proper (equiv ==> equiv ==> equiv) Mul.
>
> Instance Proper_eval : Proper (state_equiv ==> equiv ==> eq) eval.
>
>
>
> Where equiv is the equivalence of expressions, eval is the evaluation
> function (first argument is the state) and Const Var Add and Mul are
> constructors of the expression type.
>
>
>
> I wonder what it would take to e.g. lift the commutative law for natural
> numbers to expressions such that I can use it with e.g. setoid rewrite to
> swap the arguments of Add? Can I somehow define that + on nat and Add for
> expressions are equivalent operators under the eval transformation?
>
>
>
> Best regards,
>
>
>
> Michael
>
> Intel Deutschland GmbH
> Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
> Tel: +49 89 99 8853-0, www.intel.de
> Managing Directors: Christin Eisenschmid, Christian Lamprechter
> Chairperson of the Supervisory Board: Nicole Lau
> Registered Office: Munich
> Commercial Register: Amtsgericht Muenchen HRB 186928
- [Coq-Club] Inductive types and isomorphisms...., Fred Smith, 05/06/2018
- Re: [Coq-Club] Inductive types and isomorphisms...., Gaëtan Gilbert, 05/06/2018
- Re: [Coq-Club] Inductive types and isomorphisms...., José Manuel Rodriguez Caballero, 05/06/2018
- Re: [Coq-Club] Inductive types and isomorphisms...., Morrisett, 05/06/2018
- Re: [Coq-Club] Inductive types and isomorphisms...., Fred Smith, 05/07/2018
- Re: [Coq-Club] Inductive types and isomorphisms...., James Lottes, 05/07/2018
- Re: [Coq-Club] Inductive types and isomorphisms...., Matthieu Sozeau, 05/08/2018
- RE: [Coq-Club] Inductive types and isomorphisms...., Soegtrop, Michael, 05/08/2018
- Re: [Coq-Club] Inductive types and isomorphisms...., Bas Spitters, 05/08/2018
- RE: [Coq-Club] Inductive types and isomorphisms...., Soegtrop, Michael, 05/09/2018
- Re: [Coq-Club] Inductive types and isomorphisms...., Bas Spitters, 05/09/2018
- Re: [Coq-Club] Inductive types and isomorphisms...., Théo Zimmermann, 05/09/2018
- Re: [Coq-Club] Inductive types and isomorphisms...., Bas Spitters, 05/09/2018
- RE: [Coq-Club] Inductive types and isomorphisms...., Soegtrop, Michael, 05/09/2018
- Re: [Coq-Club] Inductive types and isomorphisms...., Bas Spitters, 05/08/2018
- RE: [Coq-Club] Inductive types and isomorphisms...., Soegtrop, Michael, 05/08/2018
- Re: [Coq-Club] Inductive types and isomorphisms...., Matthieu Sozeau, 05/08/2018
- Re: [Coq-Club] Inductive types and isomorphisms...., Gaëtan Gilbert, 05/06/2018
Archive powered by MHonArc 2.6.18.