coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Emilio Jesús Gallego Arias <e AT x80.org>
- To: Christopher Ernest Sally <christopherernestsally AT gmail.com>
- Cc: coq-club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] Rewriting/Morphism/Partial Point-wise equality
- Date: Thu, 06 May 2021 21:10:29 +0200
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=e AT x80.org; spf=Pass smtp.mailfrom=e AT x80.org; spf=Pass smtp.helo=postmaster AT x80.org
- Ironport-hdrordr: A9a23:WINbAakhplMO9a6loDKqP6PqN3DpDfIM3DAbv31ZSRFFG/FwWfrAoB17726NtN91YhodcL+7Scy9qB/nmKKdpLNhWYtKPzOWwVeACIlj6M/MxTjkHTPj76ph085bAspD4b/LfD9HZBbBgTVQeuxIqLO6GeKT5ds2pE0CcegFUc1dBktCe2Cm+oAdfngkOaYE
- Ironport-phdr: A9a23:BaaKIxLD+yg2cIm7UtmcuJ9mWUAX0o4c3iYr45Yqw4hDbr6kt8y7ehCGtLM30AeCAdqTwskHotKei7rnV20E7MTJm1E5W7sIaSU4j94LlRcrGs+PBB6zBvfraysnAJYKDwc9rDm0PkdPBcnxeUDZrGGs4j4OABX/Mhd+KvjoFoLIgMm7yuS/94fNbwhHmDaxbrx/IRerpgjNq8cahpdvJLwswRXTuHtIfOpWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3sp683xtBnMVhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs5Qiqp4bt1RxD0iScHLz85/3/Risxsl6JQvRatqwViz4LIfI2ZMfxzdb7fc9wHX2pMRsZfWTJcDIO7YYsBAegOM+VWoIbyu1QDtge+CRW2Ce/z1jNFnH370Ksn2OohCwHG2wkgEsoBvnTRrdX1MKYSUeetw6fM0zrDdOlO2Szl54bJaB8hpfWMUqx/ccrW0UYiCxnFjlSKpoz+IjiY0foCvnOU7udjSe6jkWknqxt+ojW2wMonl4bGiJ4PxF/e6SV53Jg6Jce+SENjf9OpE5VduS6aOYZ1TM0vQnxltSY0xLAYp5O2fTYHxpopyhDfdfGLboiG7w79WOuTIjp1hG5odbG7ihuz7USuyuvxXdS33lZStidJj9rBu3MX2xDN9MSKS+Fx8lqj1DqSzQzf9+9JLV4smafZKJMt2KM8m54dvEjZACP7lkr7gLWLekgg/OWj9v7pba/8ppCGMo95kgH+Pboqmsy4Gek5PQsDU3SB9eS7zr3j8lX1QLRMjvIojqnUqI3WKMcYq6KjHQNZzIcu5wyiAzqkzdgUh2QLIVxbdB6fiojmIVDOIPT2DfelhFSslS9myO7dM7zuAZjBMmLPkLD7fbZy80Jc0hY8zchD55JIDbEMOO78WkjotNDBEhA5NxG0zP38BdVm1oIeXHqPDbWDPKPTt1+I/OMvLPOWaI8bojauY8QistXul34ihVgFfaSzlbYNbn2jArxdKkGdcDK4idcbEHwWuRI+QfbnkluPSiJIbnK2Tooz4zg6DMStCoKVFa63h7nU8SK6GpxRUUJLEcKXJljhc4GJVPA7QTiTK9QpxjEsRej5DYg72kf950fB17N7I7+MqWUjvpX52Y0wvrWL/fnX3SwkV4KayW7fFwmccUsYF2dw27pw8xUVIrarwfggxftCGo4Kj84=
- Organization: X80 Heavy Industries
Hi Christopher,
Christopher Ernest Sally <christopherernestsally AT gmail.com> writes:
> In a dev, I'm working with a common representation of fixed width integers,
> i.e. int := (Z, <a proof that the Z is in some bound>).
>
> When doing arithmetic over the Z, I want to ignore the proof (and having
> proof irrelevance is fine for the dev).
>
> I have 2 questions
>
> 1. Is there an easy / already-common way to set the dev up for this?
> Or am I left with declaring eq' x y:= fst x = fst y and then a whole
> bunch of compat axioms, Morphisms etc?
>
> 2. A more general problem I have is when working with functions that
> return an in, (e.g. f x = y) I obviously have Logic.eq, and when
> rewriting
> with such equalities, I sometimes get a goal where I'm trying to prove
> Logic.eq x y from a eq' x y hypothesis. Is there a general fix for this?
> from both a mathematical and Coq (mechanisms) perspective.
My reference setup when working with this kind of structures is to use
the `subType` pattern provided by the mathematical components library,
which is indeed applicable to any type of the shape:
{ x : T | P x } where P : T -> T -> bool [so irrelevance holds for free]
This provides reasonable support for both going to the base type, as
well as inferring the invariant for common operations [see for example
math-comp's tuple implementation]
For modular arithmetic, at least in the reasoning part, I find it easier
to work with the representation for ints used in math-comp again, which
re-defines the operations to be modular, then you can handle them using
the regular machinery for algebra.
Kind regards,
Emilio
- [Coq-Club] Rewriting/Morphism/Partial Point-wise equality, Christopher Ernest Sally, 05/06/2021
- Re: [Coq-Club] Rewriting/Morphism/Partial Point-wise equality, Xavier Leroy, 05/06/2021
- Re: [Coq-Club] Rewriting/Morphism/Partial Point-wise equality, Christopher Ernest Sally, 05/08/2021
- Re: [Coq-Club] Rewriting/Morphism/Partial Point-wise equality, Emilio Jesús Gallego Arias, 05/06/2021
- Re: [Coq-Club] Rewriting/Morphism/Partial Point-wise equality, Xavier Leroy, 05/06/2021
Archive powered by MHonArc 2.6.19+.