Skip to Content.
Sympa Menu

coq-club - [Coq-Club] A reduction for the nat recursor

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] A reduction for the nat recursor


Chronological Thread 
  • From: Jasper Hugunin <jasperh AT cs.washington.edu>
  • To: coq-club AT inria.fr
  • Subject: [Coq-Club] A reduction for the nat recursor
  • Date: Tue, 2 Jan 2018 16:20:17 +0900
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=jasperh AT cs.washington.edu; spf=None smtp.mailfrom=jasperh AT cs.washington.edu; spf=None smtp.helo=postmaster AT mail-ot0-f178.google.com
  • Ironport-phdr: 9a23:qxH7LB+7PRpaMP9uRHKM819IXTAuvvDOBiVQ1KB40eocTK2v8tzYMVDF4r011RmVBdyds6oMotGVmpioYXYH75eFvSJKW713fDhBt/8rmRc9CtWOE0zxIa2iRSU7GMNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1Ifn+FpLPg8it2O2+54Dfbx9UiDahfLh/MAi4oQLNu8cMnIBsMLwxyhzHontJf+RZ22ZlLk+Nkhj/+8m94odt/zxftPw9+cFAV776f7kjQrxDEDsmKWE169b1uhTFUACC+2ETUmQSkhpPHgjF8BT3VYr/vyfmquZw3jSRMMvrRr42RDui9b9mRh/mhikEKjA37n3Yh9dqg65Huh+svQBzz5LWbYyTKfFwfrndfdQfRWdZWsheTTdBApuiYIsVEuEPP/tYr4bgp1sIrBu+AxSnCeTtyjBSnX/2xbM10/4hEQzdwAMgBMgCsXrOo9XuNKcSUOa1zKbUzTXEafNawyny55XVch04p/yHQLF+cdLJxEQtGA7JlEicpZLlMj+P1ekBrXKX4/diWO+sjWMstht/rSK1xsg2j4nEnoIVxU7A9SV+2Is1IMe3SE9/YdK9F5tQqz2WO5J4Qs8/QWxluzw2yrIBuZ68cygKzIooywTDZPyAdoiE+hPjVOCPLjdknH9oer2yiwyv/US+yuDwTMq53EhQoiZYkNTBtWgB1xnJ5ciGTvt98F2h2TGK1w3L6OFLO1s0lbLFJJ47wr49jYYcsV/ZEi74gkr2l6+WdkQi+uin9+TnZbPmqoWCOIBplwHyKr4uldCnAeQkLggOWHCW9vi71L365EH2XLFKjuAtnaTCq5DbJcEbprajDANP04Yj7Qy/Dza839gCk3kHNgENRBXShI/wflrKPfrQDPGlgl3qni046erBO+jDC47VI2KLsKruYLB87QYIygMo1d1F57pfEfceKenzW0n+qNveSBI1LlrnkK7cFNxh29ZGCiq0CaiDPfaKvA==

Hello,

I ran into the following function:
(fix shift n := match n with O => a | S m => shift m end) : nat -> A
which clearly on any concrete n reduces to a.

It would be very convenient if this was judgmentally equal to (fun _ => a).
Of course, this is not implemented in Coq, but I haven't been able find any references discussing such a reduction. Does anyone know what the cost of adding such a reduction would be?
(does it break decidable type-checking, or introduce unreasonable computational overhead?)

Where this comes from, is that I actually have a family of types A : nat -> Type, along with
forall n, A n = A (S n), and a0 : A 0. My function then looks like (fun n => nat_rect A a0 (coerce) n),
but for some specific instances A is actually independent of n, and the equalities are eq_refl.
In the general case, I don't see how to do a useful reduction, but when given such nice data I would
have liked to return just a, independent of n.

- Jasper Hugunin




Archive powered by MHonArc 2.6.18.

Top of Page