{"id":28531123,"url":"https://github.com/arthuraa/extructures","last_synced_at":"2025-07-07T12:31:31.255Z","repository":{"id":29031016,"uuid":"120051419","full_name":"arthuraa/extructures","owner":"arthuraa","description":"Finite sets and maps for Coq with extensional equality","archived":false,"fork":false,"pushed_at":"2025-06-09T01:31:06.000Z","size":501,"stargazers_count":30,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-09T15:04:26.737Z","etag":null,"topics":["coq","finite-sets","mathcomp","ssreflect"],"latest_commit_sha":null,"homepage":null,"language":"Coq","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arthuraa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-02-03T02:09:51.000Z","updated_at":"2025-03-28T09:26:59.000Z","dependencies_parsed_at":"2023-10-11T20:55:08.207Z","dependency_job_id":"1c3612db-00ca-4018-854a-5abfcdb88dc0","html_url":"https://github.com/arthuraa/extructures","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/arthuraa/extructures","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthuraa%2Fextructures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthuraa%2Fextructures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthuraa%2Fextructures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthuraa%2Fextructures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arthuraa","download_url":"https://codeload.github.com/arthuraa/extructures/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthuraa%2Fextructures/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264077294,"owners_count":23553825,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coq","finite-sets","mathcomp","ssreflect"],"created_at":"2025-06-09T15:01:10.447Z","updated_at":"2025-07-07T12:31:31.248Z","avatar_url":"https://github.com/arthuraa.png","language":"Coq","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Extensional Structures\n\n[![arthuraa](https://circleci.com/gh/arthuraa/extructures.svg?style=shield)](https://circleci.com/gh/arthuraa/extructures)\n\nThis package provides Coq data structures that support extensional reasoning,\nfor which the notion of equality coincides with exhibiting the same _observable\nbehavior_: sets are equal when they contain the same elements; functions are\nequal when that produce the same outputs; etc.\n\n## Features\n\n*Axiom independent* ─ Unlike the case of built-in functions and predicates,\nthese extensionality principles do not rely on any axioms beyond Coq's theory.\n\n*Executable* ─ Data structures are implemented as ordered lists and behave\nreasonably when extracted (as long as you do not have high expectations for\nperformance).\n\n*Compatible with Mathematical Components* ─ The design is inspired by\n[SSReflect][1] and the [Mathematical Components libraries][2], and attempts to\nfollow their style and philosophy.\n\n## Usage\n\nCurrently, four data structures are supported:\n\n- `{fset T}`, the type of finite sets of elements of `T` (defined in `fset`)\n\n- `{fmap T -\u003e S}`, the type of maps, or partial functions from `T` to `S` with\n  finite domain (defined in `fmap`)\n\n- `ffun def`, the type of finitely supported functions, which agree with `def :\n  T -\u003e S` on all but finitely many inputs\n\n- `{fperm T}`, the type of finitely supported permutations on `T`; that is,\n  functions `f` from `T` to `T` that have a right and left inverse and such that\n  `f x != x` only for finitely many values of `x` (defined in `fperm`)\n\nHere, `T` ranges over instances of `ordType` (defined in `ord`), which are types\nendowed with a decidable total order relation.  (For `ffun def`, the codomain of\n`def` must be an `eqType` as well.) Basic data types such as `nat`, `bool`,\n`option`, products, and sums are all pre-declared as instances of `ordType`.\nInstances for other types can be transported via subtyping, injective functions,\netc., as for other MathComp classes, or derived automatically using\n[Deriving][7].\n\nThe function-like structures coerce into Coq functions, allowing us to write\n`f x` to retrieve the value of the map `f` at `x`.  Similarly, sets coerce to\nSSReflect collective predicates, allowing us to write `x \\in A` to express that\n`x` belongs to the set `A`.\n\nExtensional reasoning is provided by the following lemmas:\n\n    eq_fset  : forall T   (A B : {fset T}),      A =i B \u003c-\u003e A = B\n    eq_fmap  : forall T S (f g : {fmap T -\u003e S}), f =1 g \u003c-\u003e f = g\n    eq_ffun  : forall T S (def : T -\u003e S) (f g : ffun def),\n                                                 f =1 g \u003c-\u003e f = g\n    eq_fperm : forall T   (f g : {fperm T}),     f =1 g \u003c-\u003e f = g\n\nDocumentation for the libraries is currently scarce, but will be progressively\nadded as comments in the headers of the files.  Once the package is installed,\nit can be required using the `extructures` qualifier.\n\n    From extructures Require Import ord fset.\n\nCheck the `tests/` directory for detailed examples.\n\n## Installation\n\nThe easiest way to install the package is through the [OPAM Coq archive][3].\nAfter installing OPAM and adding the Coq archive, run:\n\n    opam install coq-extructures\n\nAlternatively, you can compile the package by hand.  You'll need the following\ndependencies:\n\n- Coq v8.17 -- v8.20\n- [Ssreflect][2] v2.0 -- v2.3 (`coq-mathcomp-ssreflect` on OPAM).\n- `deriving` v0.2 (https://github.com/arthuraa/deriving)\n\nTo compile the package, simply run\n\n    make\n\nAfter compilation, you can install the package by running\n\n    make install\n\n## Alternatives\n\nOther packages with similar goals are available out there.\n\n- Mathematical Components also includes implementations of sets and functions\n  with extensional equality, but they only work for finite types.  In contrast,\n  the above definitions work with infinite types as well.\n\n- Cyril Cohen's `finmap` library, [available here][4].\n\n- Pierre-Yves Strub's library, [available here][5].\n\n- Christian Doczkal's library, [available here][6].\n\n  [1]: https://coq.inria.fr/distrib/current/refman/ssreflect.html\n  [2]: https://github.com/math-comp/math-comp\n  [3]: https://github.com/coq/opam-coq-archive\n  [4]: https://github.com/math-comp/finmap\n  [5]: https://github.com/strub/ssrmisc/blob/master/fset.v\n  [6]: https://www.ps.uni-saarland.de/formalizations/fset/html/libs.fset.html\n  [7]: https://github.com/arthuraa/deriving\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthuraa%2Fextructures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farthuraa%2Fextructures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthuraa%2Fextructures/lists"}