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: "Soegtrop, Michael" <michael.soegtrop AT intel.com>
  • To: "coq-club AT inria.fr" <coq-club AT inria.fr>
  • Subject: RE: [Coq-Club] Inductive types and isomorphisms....
  • Date: Tue, 8 May 2018 17:07:23 +0000
  • Accept-language: de-DE, en-US
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=michael.soegtrop AT intel.com; spf=Pass smtp.mailfrom=michael.soegtrop AT intel.com; spf=None smtp.helo=postmaster AT mga12.intel.com
  • Dlp-product: dlpe-windows
  • Dlp-reaction: no-action
  • Dlp-version: 11.0.200.100
  • Ironport-phdr: 9a23:kNjxIBU02U3PJN+RgqLz0+rHbizV8LGtZVwlr6E/grcLSJyIuqrYbBCBt8tkgFKBZ4jH8fUM07OQ7/i7HzRYqb+681k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRoLerpBIHSk9631+ev8JHPfglEnjWwba98IRmssQndqtQdjJd/JKo21hbHuGZDdf5MxWNvK1KTnhL86dm18ZV+7SleuO8v+tBZX6nicKs2UbJXDDI9M2Ao/8LrrgXMTRGO5nQHTGoblAdDDhXf4xH7WpfxtTb6tvZ41SKHM8D6Uaw4VDK/5KptVRTmijoINyQh/W/XlMJ+kb5brhyiqRxxwYHUYZ2aO/Vlc6zHYd8XQXBMUtpNWyFDBI63cosBD/AGPeZdt4TxqUYArRygCgmjGOPv0DhIhmfu0aYn1OohEB3J3Aw6EN0QtHTYosj+OaAXUeC00KbIzS/MYO1S2Tvn84jIdQ4uof6QXbJqdsrR0VIiFwLDjlWMt4PlOymZ2fgKs2ie9udtU/+khWAgqwF0uDevx8Esh5HIhoIT1lDL6yF5zJwoKtKmTkNwfN2qEINIui2HM4Z6XNkuTmFotSogyrAKp4S3cDUExZkm3xLTdv2KfoaS7h/tWuudOyl0iXxhdb6lmhq/8lasxvXhWsS11FtGtDRJn9nDu3wXyRDf8NaLR/R580qnxD2BzRrc6vteLkAxjafbK4Auwro3lpcLtETDETX5lFjogKOMd0Uk/PSo5PrjYrn8upCcMIp0hhn/MqQohMO/Hfw1PhUKUmSF4+ix1L3u8Vf5TblUlPE6j6fUvZHCKcQevKG5AgtV0og56xa4CjeryNEYnXgbI1JFYh2IkYzpN0vVIPD/E/i/jEiskC1sx/DeJbDhA5PNLmTdn7flZ7py90lcyA8rwdBF+51UEq0BIO70WkLpqNPYCQY5PxWozObjFdVyzZgTWXmPA6+cKKPdq0WE5uMpI+mWZY8aoizxK/Y/562msXhs01QaZOyi2YYdQHG+BPVvZUuDKzK4idAYVGwOowAWTerwiVTEXyQFNFioWKdprAo8BY26F4DbAsiIgbeB1Sq/VNUCY2FNClmBFTHzcIiLR+0LcAqTJNNslnoPUr33GNxp7g2nqAKvk+kvFeHT4CBN7cuyhugw3PXakFQJzRIxCs2c12+XSGQtxzEJQSM72OZ0pkkvkw7fg5g9uORREJlo390MSh0zbMeOzupmBtS0UQXELI/QFQSWB+6+CDR0deofht8DZ0EkRIengRmahWyrBaMYk/qAA5lmqq8=

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




Archive powered by MHonArc 2.6.18.

Top of Page